summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-12-07 19:46:36 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-12-07 19:46:36 +0000
commita5ececcfef96840921f1d24df1d4adb0b00f8ad3 (patch)
tree026a8c7c53b94997fc7cc4568d955f226d277360
parent0d768a37f970b40575ef2be169e670fd6b5d424a (diff)
downloadrockbox-a5ececcfef96840921f1d24df1d4adb0b00f8ad3.zip
rockbox-a5ececcfef96840921f1d24df1d4adb0b00f8ad3.tar.gz
rockbox-a5ececcfef96840921f1d24df1d4adb0b00f8ad3.tar.bz2
rockbox-a5ececcfef96840921f1d24df1d4adb0b00f8ad3.tar.xz
Oops, that'll just keep resetting the timeout to 20s every time sys_poweroff is called and won't add the 8s recording margin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11686 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/powermgmt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 458745f..90ac492 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -1267,16 +1267,18 @@ void sys_poweroff(void)
logf("sys_poweroff()");
/* If the main thread fails to shut down the system, we will force a
power off after an 20 second timeout - 28 seconds if recording */
-#if defined(IAUDIO_X5) && !defined (SIMULATOR)
if (shutdown_timeout == 0)
+ {
+#if defined(IAUDIO_X5) && !defined (SIMULATOR)
pcf50606_reset_timeout(); /* Reset timer on first attempt only */
#endif
#ifdef HAVE_RECORDING
- if (audio_status() & AUDIO_STATUS_RECORD)
- shutdown_timeout += HZ*8;
+ if (audio_status() & AUDIO_STATUS_RECORD)
+ shutdown_timeout += HZ*8;
#endif
+ shutdown_timeout += HZ*20;
+ }
- shutdown_timeout = HZ*20;
queue_post(&button_queue, SYS_POWEROFF, NULL);
}