summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-06-14 05:03:49 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-06-14 05:03:49 +0000
commite3548c3624bdcd275c2ffaea0427ead766aad64f (patch)
treee512b052e70175f3c2ff3fe0ef95b3d5a21d8d2f /firmware/powermgmt.c
parent0e26af97a6ed52987e3499f748a72d1b710ed068 (diff)
downloadrockbox-e3548c3624bdcd275c2ffaea0427ead766aad64f.tar.gz
rockbox-e3548c3624bdcd275c2ffaea0427ead766aad64f.zip
The sleep timer now waits until the disk is idle before shutting down
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4737 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index c7c299092c..61006459ff 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -339,6 +339,10 @@ static void handle_auto_poweroff(void)
339 else 339 else
340 { 340 {
341 DEBUGF("Sleep timer timeout. Shutting off...\n"); 341 DEBUGF("Sleep timer timeout. Shutting off...\n");
342 /* Make sure that the disk isn't spinning when
343 we cut the power */
344 while(ata_disk_is_active())
345 sleep(HZ);
342 power_off(); 346 power_off();
343 } 347 }
344 } 348 }