aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/lua.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-07-28 23:19:54 +0200
committercbdev <cb@cbcdn.com>2019-07-28 23:19:54 +0200
commitaef72140273b3d98a4d86a42f0f3bcce6d5899ca (patch)
tree61771bad087e6cda87052c938328e5b6354d7ead /backends/lua.c
parent0bb690437795f1be0f68c562fc2b9dbc66bc97a8 (diff)
downloadmidimonster-aef72140273b3d98a4d86a42f0f3bcce6d5899ca.tar.gz
midimonster-aef72140273b3d98a4d86a42f0f3bcce6d5899ca.tar.bz2
midimonster-aef72140273b3d98a4d86a42f0f3bcce6d5899ca.zip
Fix Lua timing on non-linux
Diffstat (limited to 'backends/lua.c')
-rw-r--r--backends/lua.c11
1 files changed, 9 insertions, 2 deletions
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;
}