diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-01-03 13:27:19 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-01-03 13:27:19 +0000 |
commit | 4b472de39b30c079ff846aec83d2da33cc0adcc5 (patch) | |
tree | f2435c9307c6aa495f4dc34c098290ddad3f97c3 /apps/plugins | |
parent | 3681ff197d3cf5393df3d56d7b6f7b39af0fc47f (diff) | |
download | rockbox-4b472de39b30c079ff846aec83d2da33cc0adcc5.tar.gz rockbox-4b472de39b30c079ff846aec83d2da33cc0adcc5.zip |
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
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 7c67cca937..6559f535af 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c | |||
@@ -224,6 +224,7 @@ static unsigned int buf_idx; | |||
224 | 224 | ||
225 | bool exit_tsr(bool reenter) | 225 | bool exit_tsr(bool reenter) |
226 | { | 226 | { |
227 | long button; | ||
227 | (void)reenter; | 228 | (void)reenter; |
228 | rb->lcd_clear_display(); | 229 | rb->lcd_clear_display(); |
229 | rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running."); | 230 | rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running."); |
@@ -233,15 +234,21 @@ bool exit_tsr(bool reenter) | |||
233 | #endif | 234 | #endif |
234 | rb->lcd_update(); | 235 | rb->lcd_update(); |
235 | 236 | ||
236 | if (rb->button_get(true) == BATTERY_OFF) | 237 | while (1) |
237 | { | 238 | { |
238 | rb->queue_post(&thread_q, EV_EXIT, 0); | 239 | button = rb->button_get(true); |
239 | rb->thread_wait(thread_id); | 240 | if (IS_SYSEVENT(button)) |
240 | /* remove the thread's queue from the broadcast list */ | 241 | continue; |
241 | rb->queue_delete(&thread_q); | 242 | if (button == BATTERY_OFF) |
242 | return true; | 243 | { |
244 | rb->queue_post(&thread_q, EV_EXIT, 0); | ||
245 | rb->thread_wait(thread_id); | ||
246 | /* remove the thread's queue from the broadcast list */ | ||
247 | rb->queue_delete(&thread_q); | ||
248 | return true; | ||
249 | } | ||
250 | else return false; | ||
243 | } | 251 | } |
244 | else return false; | ||
245 | } | 252 | } |
246 | 253 | ||
247 | #define BIT_CHARGER 0x1 | 254 | #define BIT_CHARGER 0x1 |
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c index 376ae7f80f..6380f6dbdb 100644 --- a/apps/plugins/firmware_flash.c +++ b/apps/plugins/firmware_flash.c | |||
@@ -592,7 +592,7 @@ int WaitForButton(void) | |||
592 | do | 592 | do |
593 | { | 593 | { |
594 | button = rb->button_get(true); | 594 | button = rb->button_get(true); |
595 | } while (button & BUTTON_REL); | 595 | } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); |
596 | 596 | ||
597 | return button; | 597 | return button; |
598 | } | 598 | } |
diff --git a/apps/plugins/iriver_flash.c b/apps/plugins/iriver_flash.c index 9f26f82d13..e7ae056d38 100644 --- a/apps/plugins/iriver_flash.c +++ b/apps/plugins/iriver_flash.c | |||
@@ -230,7 +230,7 @@ int wait_for_button(void) | |||
230 | do | 230 | do |
231 | { | 231 | { |
232 | button = rb->button_get(true); | 232 | button = rb->button_get(true); |
233 | } while (button & BUTTON_REL); | 233 | } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); |
234 | 234 | ||
235 | return button; | 235 | return button; |
236 | } | 236 | } |
diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c index e355ee4ce3..ace6545865 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 */ | |||
110 | /* this is the plugin entry point */ | 110 | /* this is the plugin entry point */ |
111 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) | 111 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) |
112 | { | 112 | { |
113 | long button; | ||
113 | (void)parameter; | 114 | (void)parameter; |
114 | rb = api; | 115 | rb = api; |
115 | 116 | ||
@@ -167,7 +168,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame | |||
167 | rb->lcd_clear_display(); | 168 | rb->lcd_clear_display(); |
168 | rb->lcd_update(); | 169 | rb->lcd_update(); |
169 | 170 | ||
170 | switch(rb->button_get(true)) | 171 | switch((button = rb->button_get(true))) |
171 | { | 172 | { |
172 | case LAMP_RIGHT: | 173 | case LAMP_RIGHT: |
173 | #ifdef LAMP_NEXT | 174 | #ifdef LAMP_NEXT |
@@ -196,9 +197,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame | |||
196 | case (LAMP_PREV|BUTTON_REL): | 197 | case (LAMP_PREV|BUTTON_REL): |
197 | #endif /* LAMP_PREV */ | 198 | #endif /* LAMP_PREV */ |
198 | /* eat these... */ | 199 | /* eat these... */ |
199 | break; | 200 | break; |
200 | default: | 201 | default: |
201 | quit = true; | 202 | if (!IS_SYSEVENT(button)) |
203 | quit = true; | ||
202 | } | 204 | } |
203 | } while (!quit); | 205 | } while (!quit); |
204 | 206 | ||
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c index 6323ca9736..d0dc73875e 100644 --- a/apps/plugins/rockbox_flash.c +++ b/apps/plugins/rockbox_flash.c | |||
@@ -516,7 +516,7 @@ static int WaitForButton(void) | |||
516 | do | 516 | do |
517 | { | 517 | { |
518 | button = rb->button_get(true); | 518 | button = rb->button_get(true); |
519 | } while (button & BUTTON_REL); | 519 | } while (IS_SYSEVENT(button) || (button & BUTTON_REL)); |
520 | 520 | ||
521 | return button; | 521 | return button; |
522 | } | 522 | } |