All functions implement, but not running
This commit is contained in:
		| @@ -34,6 +34,7 @@ public class ESP8266Node extends TwoArgFunction { | ||||
|         final LuaTable node = new LuaTable(); | ||||
|         node.set("compile", new CompileFunction()); | ||||
|         node.set("restart", new RestartFunction()); | ||||
|         node.set("heap", new HeapFunction()); | ||||
|         env.set("node", node); | ||||
|         env.get("package").get("loaded").set("node", node);         | ||||
|         return node; | ||||
| @@ -73,6 +74,18 @@ public class ESP8266Node extends TwoArgFunction { | ||||
|          | ||||
|     } | ||||
|      | ||||
|     private class HeapFunction extends ZeroArgFunction { | ||||
|  | ||||
|         @Override | ||||
|         public LuaValue call() { | ||||
|             System.out.println("[Node] Heap");             | ||||
|             return LuaValue.valueOf(Runtime.getRuntime().freeMemory()); | ||||
|         } | ||||
|          | ||||
|     } | ||||
|      | ||||
|  | ||||
|      | ||||
|     public void setWorkingDirectory(File workingDir) { | ||||
|         this.workingDir = workingDir;         | ||||
|     } | ||||
|   | ||||
| @@ -34,6 +34,7 @@ public class ESP8266Tmr extends TwoArgFunction { | ||||
|         tmr.set("stop", new stop()); | ||||
|         tmr.set("alarm", new alarm()); | ||||
|         tmr.set("create", new create()); | ||||
|         tmr.set("wdclr", new watchDog()); | ||||
|         env.set("tmr", tmr); | ||||
|         env.get("package").get("loaded").set("tmr", tmr); | ||||
|          | ||||
| @@ -127,6 +128,15 @@ public class ESP8266Tmr extends TwoArgFunction { | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     private class watchDog extends ZeroArgFunction { | ||||
|     	 | ||||
|         public LuaValue call() { | ||||
|             System.out.println("[TMR] Watchdog fed"); | ||||
|             return LuaValue.valueOf(true);    | ||||
|              | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     private class dynStop extends ZeroArgFunction { | ||||
|     	private final int dynIndex; | ||||
|     	public dynStop(int index) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user