From: Nathaniel Wesley Filardo Date: Tue, 7 Nov 2017 08:45:06 +0000 (-0500) Subject: linux-draw: add more tmr functions X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=8696a8e1fa862bc464c4e249defce66acd6be409;p=acmetensortoys-esp-lua_lamp linux-draw: add more tmr functions --- diff --git a/linux-draw.lua b/linux-draw.lua index 22170f1..13f6f46 100644 --- a/linux-draw.lua +++ b/linux-draw.lua @@ -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 = {}