From 4b472de39b30c079ff846aec83d2da33cc0adcc5 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sat, 3 Jan 2009 13:27:19 +0000 Subject: a few more button/statusbar fixes... * hopefully fix the last of the plugins which dont handle the enw SYS event. * fix FS#9750 - WPS's which dont specify (or force the wps on) wernt showing the statusbar at all * lamp, battery_bench, *_flash button handling fixes * plugins using the core menu code will again show the statusbar git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19656 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/battery_bench.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'apps/plugins/battery_bench.c') diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 7c67cca937..6559f535af 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 -- cgit v1.2.3