summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index e59e2d50b9..458745f0d9 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -1266,16 +1266,17 @@ void sys_poweroff(void)
1266{ 1266{
1267 logf("sys_poweroff()"); 1267 logf("sys_poweroff()");
1268 /* If the main thread fails to shut down the system, we will force a 1268 /* If the main thread fails to shut down the system, we will force a
1269 power off after an 20 second timeout */ 1269 power off after an 20 second timeout - 28 seconds if recording */
1270 shutdown_timeout = HZ*20; 1270#if defined(IAUDIO_X5) && !defined (SIMULATOR)
1271#if defined(HAVE_RECORDING) 1271 if (shutdown_timeout == 0)
1272 int audio_stat = audio_status(); 1272 pcf50606_reset_timeout(); /* Reset timer on first attempt only */
1273 if (audio_stat & AUDIO_STATUS_RECORD) {
1274 audio_stop_recording();
1275 shutdown_timeout += 8*HZ;
1276 }
1277#endif 1273#endif
1278 1274#ifdef HAVE_RECORDING
1275 if (audio_status() & AUDIO_STATUS_RECORD)
1276 shutdown_timeout += HZ*8;
1277#endif
1278
1279 shutdown_timeout = HZ*20;
1279 queue_post(&button_queue, SYS_POWEROFF, NULL); 1280 queue_post(&button_queue, SYS_POWEROFF, NULL);
1280} 1281}
1281 1282