From 8055825312a111b6c41503e72d3b08cecb95aa28 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 9 Oct 2006 12:14:25 +0000 Subject: fix the shutdown screen on the recorder git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11160 a1c6a512-1295-4272-9138-f99709370657 --- apps/screens.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'apps') diff --git a/apps/screens.c b/apps/screens.c index d9cfc11d00..b27dae1916 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -981,34 +981,31 @@ bool shutdown_screen(void) { int button; bool done = false; + long time_entered = current_tick; lcd_stop_scroll(); gui_syncsplash(0, true, str(LANG_CONFIRM_SHUTDOWN)); - while(!done) + while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2)) { - button = get_action(CONTEXT_STD,HZ*2); + button = get_action(CONTEXT_STD,HZ); switch(button) { case ACTION_STD_CANCEL: sys_poweroff(); break; + /* do nothing here, because ACTION_UNKNOWN might be caused + * by timeout or button release. In case of timeout the loop + * is terminated by TIME_BEFORE */ + case ACTION_UNKNOWN: + break; + default: if(default_event_handler(button) == SYS_USB_CONNECTED) return true; - - /* Return if any other button was pushed, or if there - was a timeout. We ignore RELEASE events, since we may - have been called by a button down event, and the user might - not have released the button yet. - We also ignore REPEAT events, since we don't want to - remove the splash when the user holds OFF to shut down. */ - /* Is this still needed? commenting out so it compiles.. - CHECK ME!! - if(!(button & (BUTTON_REL | BUTTON_REPEAT))) - */ done = true; + done = true; break; } } -- cgit v1.2.3