summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rocklib_events.c')
-rw-r--r--apps/plugins/lua/rocklib_events.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/plugins/lua/rocklib_events.c b/apps/plugins/lua/rocklib_events.c
index 961fea030c..bf94cabe8a 100644
--- a/apps/plugins/lua/rocklib_events.c
+++ b/apps/plugins/lua/rocklib_events.c
@@ -139,7 +139,6 @@ struct event_data {
139 long *event_stack; 139 long *event_stack;
140 volatile long *get_tick; 140 volatile long *get_tick;
141 struct thread_status status; 141 struct thread_status status;
142 char next_event;
143 /* callbacks */ 142 /* callbacks */
144 struct cb_data *cb[EVENT_CT]; 143 struct cb_data *cb[EVENT_CT];
145}; 144};
@@ -232,7 +231,7 @@ static void lua_interrupt_set(lua_State *L, int hookmask)
232 oldmask = lua_gethookmask(L); 231 oldmask = lua_gethookmask(L);
233 oldcount = lua_gethookcount(L); 232 oldcount = lua_gethookcount(L);
234 hook = lua_interrupt_callback; 233 hook = lua_interrupt_callback;
235 count = 1; 234 count = 10;
236 } 235 }
237 else 236 else
238 { 237 {
@@ -278,7 +277,7 @@ static void rev_timer_isr(void)
278 } 277 }
279 } 278 }
280 set_evt(ev_flag); 279 set_evt(ev_flag);
281 if (--ev_data.next_event <= 0 && ev_data.status.event) 280 if (ev_data.status.event)
282 lua_interrupt_set(ev_data.L, ENABLE_LUA_HOOK); 281 lua_interrupt_set(ev_data.L, ENABLE_LUA_HOOK);
283} 282}
284 283
@@ -342,7 +341,6 @@ skip_callback:
342 do 341 do
343 { 342 {
344 lua_interrupt_set(ev_data.L, DISABLE_LUA_HOOK); 343 lua_interrupt_set(ev_data.L, DISABLE_LUA_HOOK);
345 ev_data.next_event = EV_TICKS;
346 rb->yield(); 344 rb->yield();
347 } while (!has_thread_status(THREAD_QUIT) && (is_suspend(THREAD_EVENT_ALL) 345 } while (!has_thread_status(THREAD_QUIT) && (is_suspend(THREAD_EVENT_ALL)
348 || !ev_data.status.event)); 346 || !ev_data.status.event));
@@ -540,7 +538,6 @@ static void init_event_data(lua_State *L, struct event_data *ev_data)
540 ev_data->status.thread = 0; 538 ev_data->status.thread = 0;
541 539
542 /*ev_data->event_stack = NULL;*/ 540 /*ev_data->event_stack = NULL;*/
543 ev_data->next_event = EV_TICKS;
544 /* callbacks */ 541 /* callbacks */
545 for (unsigned int i= 0; i < EVENT_CT; i++) 542 for (unsigned int i= 0; i < EVENT_CT; i++)
546 ev_data->cb[i] = NULL; 543 ev_data->cb[i] = NULL;
@@ -587,7 +584,7 @@ static int rockev_register(lua_State *L)
587 event_ticks = luaL_optinteger(L, 3, EV_INPUT); 584 event_ticks = luaL_optinteger(L, 3, EV_INPUT);
588 break; 585 break;
589 case CUSTOMEVENT: 586 case CUSTOMEVENT:
590 event_ticks = luaL_optinteger(L, 3, EV_TIMER_TICKS); 587 event_ticks = luaL_optinteger(L, 3, EV_TICKS);
591 ev_flag = 0; /* don't remove suspend */ 588 ev_flag = 0; /* don't remove suspend */
592 break; 589 break;
593 case PLAYBKEVENT: /* see register_playbk_events() for flags */ 590 case PLAYBKEVENT: /* see register_playbk_events() for flags */