From a5ececcfef96840921f1d24df1d4adb0b00f8ad3 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 7 Dec 2006 19:46:36 +0000 Subject: [PATCH] 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 --- firmware/powermgmt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 458745f0d9..90ac492fc8 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); }