summaryrefslogtreecommitdiffstats
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)
else
{
DEBUGF("Sleep timer timeout. Shutting off...\n");
+ /* Make sure that the disk isn't spinning when
+ we cut the power */
+ while(ata_disk_is_active())
+ sleep(HZ);
power_off();
}
}