From 0d768a37f970b40575ef2be169e670fd6b5d424a Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 7 Dec 2006 19:34:26 +0000 Subject: SWCODEC Recording: 1) Fix minor bug of not subtracting line aligment adjustment from buffer size. 2) Handle stop and pause better and let pcmrec thread lock the DMA as that could cause prerecording to get disabled internally 3) Make sure to snapshot DMA write index to ensure compiler doesn't perform multiple access when calculating available data (probably just paranoia on my part) 4) Handle USB connect in recording thread a little better by resetting hardware to defaults after closing 5) Make power managment stop recording properly when powering off (ie. no yield() from interrupt handler! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11685 a1c6a512-1295-4272-9138-f99709370657 --- firmware/powermgmt.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'firmware/powermgmt.c') 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) { logf("sys_poweroff()"); /* If the main thread fails to shut down the system, we will force a - power off after an 20 second timeout */ - shutdown_timeout = HZ*20; -#if defined(HAVE_RECORDING) - int audio_stat = audio_status(); - if (audio_stat & AUDIO_STATUS_RECORD) { - audio_stop_recording(); - shutdown_timeout += 8*HZ; - } + power off after an 20 second timeout - 28 seconds if recording */ +#if defined(IAUDIO_X5) && !defined (SIMULATOR) + if (shutdown_timeout == 0) + pcf50606_reset_timeout(); /* Reset timer on first attempt only */ #endif - +#ifdef HAVE_RECORDING + if (audio_status() & AUDIO_STATUS_RECORD) + shutdown_timeout += HZ*8; +#endif + + shutdown_timeout = HZ*20; queue_post(&button_queue, SYS_POWEROFF, NULL); } -- cgit v1.2.3