diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-12-07 19:34:26 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-12-07 19:34:26 +0000 |
commit | 0d768a37f970b40575ef2be169e670fd6b5d424a (patch) | |
tree | 2dbc6fe2211a3a2b1fe3aa0693196b8790b3ec78 /firmware/powermgmt.c | |
parent | 5652b2528d59b77e804f72d4f7c9854275e05b5a (diff) | |
download | rockbox-0d768a37f970b40575ef2be169e670fd6b5d424a.tar.gz rockbox-0d768a37f970b40575ef2be169e670fd6b5d424a.zip |
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
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 19 |
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 | ||