]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
linux-draw: add more tmr functions
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 7 Nov 2017 08:45:06 +0000 (03:45 -0500)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 7 Nov 2017 08:45:06 +0000 (03:45 -0500)
linux-draw.lua

index 22170f1ac09f1fe5945562b34521a939e10b0d85..13f6f469fb88986ee0bb5eb0e8d2bd25c62a3a3d 100644 (file)
@@ -65,9 +65,17 @@ function tmr.start(self)
   tmr.stop(self)
   tmr._start(self)
 end
+function tmr.alarm(self,period,mode,fn)
+  tmr.stop(self)
+  tmr.register(self,period,mode,fn)
+  tmr.start(self)
+end
 tmr_mt = { __index = tmr }
+function tmr.create()
+  return setmetatable({}, tmr_mt)
+end
 
-remotetmr = setmetatable({}, tmr_mt)
+remotetmr = tmr.create()
 
 remotefb = {}