From: jdgordon Date: Sun, 29 Jun 2008 09:44:07 +0000 (+0000) Subject: fix FS#8187 - charging breaks sleep timer. Now if the timer goes off and the player... X-Git-Url: https://repo.or.cz/w/Rockbox.git/commitdiff_plain/e26ca9d9361cccc0ff3226547a6cf48547031cfb fix FS#8187 - charging breaks sleep timer. Now if the timer goes off and the player is charging or connected to USB it will turn off the audio, but stay on git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17872 a1c6a512-1295-4272-9138-f99709370657 --- diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index dd1d5fc78..523a62007 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -462,21 +462,23 @@ static void handle_auto_poweroff(void) else { /* Handle sleeptimer */ - if(sleeptimer_active && !usb_inserted()) + if(sleeptimer_active) { if(TIME_AFTER(current_tick, sleeptimer_endtick)) { audio_stop(); + if (!usb_inserted() #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) - if((charger_input_state == CHARGER) || - (charger_input_state == CHARGER_PLUGGED)) + || ((charger_input_state == CHARGER) || + (charger_input_state == CHARGER_PLUGGED)) +#endif + ) { DEBUGF("Sleep timer timeout. Stopping...\n"); set_sleep_timer(0); backlight_off(); /* Nighty, nighty... */ } else -#endif { DEBUGF("Sleep timer timeout. Shutting off...\n"); sys_poweroff();