summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-06-29 09:44:07 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-06-29 09:44:07 +0000
commit6f6fcfc3a8510d222981d856e81250561bcc5921 (patch)
treea9ff61214577f0cb1378ccc3455d69e03ef3b5ed /firmware/powermgmt.c
parentc3400684f1276cf4079d1cf2f7397e73f99551ee (diff)
downloadrockbox-6f6fcfc3a8510d222981d856e81250561bcc5921.tar.gz
rockbox-6f6fcfc3a8510d222981d856e81250561bcc5921.zip
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
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index dd1d5fc782..523a62007a 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -462,21 +462,23 @@ static void handle_auto_poweroff(void)
462 else 462 else
463 { 463 {
464 /* Handle sleeptimer */ 464 /* Handle sleeptimer */
465 if(sleeptimer_active && !usb_inserted()) 465 if(sleeptimer_active)
466 { 466 {
467 if(TIME_AFTER(current_tick, sleeptimer_endtick)) 467 if(TIME_AFTER(current_tick, sleeptimer_endtick))
468 { 468 {
469 audio_stop(); 469 audio_stop();
470 if (!usb_inserted()
470#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) 471#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING)
471 if((charger_input_state == CHARGER) || 472 || ((charger_input_state == CHARGER) ||
472 (charger_input_state == CHARGER_PLUGGED)) 473 (charger_input_state == CHARGER_PLUGGED))
474#endif
475 )
473 { 476 {
474 DEBUGF("Sleep timer timeout. Stopping...\n"); 477 DEBUGF("Sleep timer timeout. Stopping...\n");
475 set_sleep_timer(0); 478 set_sleep_timer(0);
476 backlight_off(); /* Nighty, nighty... */ 479 backlight_off(); /* Nighty, nighty... */
477 } 480 }
478 else 481 else
479#endif
480 { 482 {
481 DEBUGF("Sleep timer timeout. Shutting off...\n"); 483 DEBUGF("Sleep timer timeout. Shutting off...\n");
482 sys_poweroff(); 484 sys_poweroff();