diff options
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/battery_bench.c | 21 | ||||
| -rw-r--r-- | apps/plugins/firmware_flash.c | 2 | ||||
| -rw-r--r-- | apps/plugins/iriver_flash.c | 2 | ||||
| -rw-r--r-- | apps/plugins/lamp.c | 8 | ||||
| -rw-r--r-- | apps/plugins/rockbox_flash.c | 2 |
5 files changed, 22 insertions, 13 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 7c67cca..6559f53 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -224,6 +224,7 @@ static unsigned int buf_idx; bool exit_tsr(bool reenter) { + long button; (void)reenter; rb->lcd_clear_display(); rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running."); @@ -233,15 +234,21 @@ bool exit_tsr(bool reenter) #endif rb->lcd_update(); - if (rb->button_get(true) == BATTERY_OFF) + while (1) { - rb->queue_post(&thread_q, EV_EXIT, 0); - rb->thread_wait(thread_id); - /* remove the thread's queue from the broadcast list */ - rb->queue_delete(&thread_q); - return true; + button = rb->button_get(true); + if (IS_SYSEVENT(button)) + continue; + if (button == BATTERY_OFF) + { + rb->queue_post(&thread_q, EV_EXIT, 0); + rb->thread_wait(thread_id); + /* remove the thread's queue from the broadcast list */ + rb->queue_delete(&thread_q); + return true; + } + else return false; } - else return false; } #define BIT_CHARGER 0x1 diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c index 376ae7f..6380f6d 100644 --- a/apps/plugins/firmware_flash.c +++ b/apps/plugins/firmware_flash.c @@ -592,7 +592,7 @@ int WaitForButton(void) do { button = rb->button_get(true); - } while (button & BUTTON_REL); + } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); return button; } diff --git a/apps/plugins/iriver_flash.c b/apps/plugins/iriver_flash.c index 9f26f82..e7ae056 100644 --- a/apps/plugins/iriver_flash.c +++ b/apps/plugins/iriver_flash.c @@ -230,7 +230,7 @@ int wait_for_button(void) do { button = rb->button_get(true); - } while (button & BUTTON_REL); + } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); return button; } diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c index e355ee4..ace6545 100644 --- a/apps/plugins/lamp.c +++ b/apps/plugins/lamp.c @@ -110,6 +110,7 @@ static int colorset[NUM_COLORSETS][3] = { { 255, 255, 255 } , /* white */ /* this is the plugin entry point */ enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { + long button; (void)parameter; rb = api; @@ -167,7 +168,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->lcd_clear_display(); rb->lcd_update(); - switch(rb->button_get(true)) + switch((button = rb->button_get(true))) { case LAMP_RIGHT: #ifdef LAMP_NEXT @@ -196,9 +197,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame case (LAMP_PREV|BUTTON_REL): #endif /* LAMP_PREV */ /* eat these... */ - break; + break; default: - quit = true; + if (!IS_SYSEVENT(button)) + quit = true; } } while (!quit); diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c index 6323ca9..d0dc738 100644 --- a/apps/plugins/rockbox_flash.c +++ b/apps/plugins/rockbox_flash.c @@ -516,7 +516,7 @@ static int WaitForButton(void) do { button = rb->button_get(true); - } while (button & BUTTON_REL); + } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); return button; } |