From aef72140273b3d98a4d86a42f0f3bcce6d5899ca Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 28 Jul 2019 23:19:54 +0200 Subject: Fix Lua timing on non-linux --- backends/lua.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'backends/lua.c') diff --git a/backends/lua.c b/backends/lua.c index 61e4e08..4a910a2 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -53,9 +53,16 @@ int init(){ } static uint32_t lua_interval(){ - //FIXME Return delta for next timer here + size_t n = 0; + uint64_t next_timer = 1000; + if(timer_interval){ - return timer_interval; + for(n = 0; n < timers; n++){ + if(timer[n].interval && timer[n].interval - timer[n].delta < next_timer){ + next_timer = timer[n].interval - timer[n].delta; + } + } + return next_timer; } return 1000; } -- cgit v1.2.3