Merge branch 'master' of github.com:0110/Wordclock
This commit is contained in:
commit
efadc4bc06
2
init.lua
2
init.lua
@ -33,7 +33,7 @@ end
|
|||||||
initTimer = tmr.create()
|
initTimer = tmr.create()
|
||||||
initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
|
initTimer:register(5000, tmr.ALARM_SINGLE, function (t)
|
||||||
bootledtimer:unregister()
|
bootledtimer:unregister()
|
||||||
t:unregister()
|
initTimer:unregister()
|
||||||
initTimer=nil
|
initTimer=nil
|
||||||
bootledtimer=nil
|
bootledtimer=nil
|
||||||
local modlist = { "timecore" , "displayword" }
|
local modlist = { "timecore" , "displayword" }
|
||||||
|
@ -111,19 +111,19 @@ public class ESP8266Tmr extends TwoArgFunction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class dynStart extends VarArgFunction {
|
private class dynStart extends ZeroArgFunction {
|
||||||
private final int dynIndex;
|
private final int dynIndex;
|
||||||
public dynStart(int index) {
|
public dynStart(int index) {
|
||||||
this.dynIndex = index;
|
this.dynIndex = index;
|
||||||
}
|
}
|
||||||
public Varargs invoke(Varargs varargs) {
|
public LuaValue call() {
|
||||||
if (varargs.narg()== 0) {
|
if (dynamicThreads[dynIndex] != null) {
|
||||||
if (dynamicThreads[dynIndex] != null) {
|
dynamicThreads[dynIndex].start();
|
||||||
dynamicThreads[dynIndex].start();
|
System.out.println("[TMR] DynTimer" + dynIndex + " started");
|
||||||
System.out.println("[TMR] DynTimer" + dynIndex + " started");
|
return LuaValue.valueOf(true);
|
||||||
}
|
} else {
|
||||||
|
return LuaValue.valueOf(false);
|
||||||
}
|
}
|
||||||
return LuaValue.valueOf(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,12 +133,14 @@ public class ESP8266Tmr extends TwoArgFunction {
|
|||||||
this.dynIndex = index;
|
this.dynIndex = index;
|
||||||
}
|
}
|
||||||
public LuaValue call() {
|
public LuaValue call() {
|
||||||
|
boolean status = false;
|
||||||
if (dynamicThreads[dynIndex] != null) {
|
if (dynamicThreads[dynIndex] != null) {
|
||||||
dynamicThreads[dynIndex].stopThread();
|
dynamicThreads[dynIndex].stopThread();
|
||||||
dynamicThreads[dynIndex] = null;
|
dynamicThreads[dynIndex] = null;
|
||||||
System.out.println("[TMR] DynTimer" + dynIndex + " stopped");
|
System.out.println("[TMR] DynTimer" + dynIndex + " stopped");
|
||||||
|
status = true;
|
||||||
}
|
}
|
||||||
return LuaValue.valueOf(true);
|
return LuaValue.valueOf(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user