From 8696a8e1fa862bc464c4e249defce66acd6be409 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Nov 2017 03:45:06 -0500 Subject: [PATCH] linux-draw: add more tmr functions --- linux-draw.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 = {} -- 2.50.1