diff options
author | Christi Scarborough <christi@coraline.org> | 2005-02-06 09:57:57 +0000 |
---|---|---|
committer | Christi Scarborough <christi@coraline.org> | 2005-02-06 09:57:57 +0000 |
commit | 247fe6d698f244123ecde9d9971e74ee99504e9e (patch) | |
tree | afd5c663351558446b1610388b9100987da13775 /firmware/powermgmt.c | |
parent | 05605866a6b9c6b01f496e580b906ababa803fe7 (diff) | |
download | rockbox-247fe6d698f244123ecde9d9971e74ee99504e9e.tar.gz rockbox-247fe6d698f244123ecde9d9971e74ee99504e9e.zip |
clean shutdown for idle timer and sleep timer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5814 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index cb9fb53fcb..91b09aa555 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -351,7 +351,7 @@ static void handle_auto_poweroff(void) | |||
351 | TIME_AFTER(current_tick, last_disk_activity + timeout) && | 351 | TIME_AFTER(current_tick, last_disk_activity + timeout) && |
352 | TIME_AFTER(current_tick, last_charge_time + timeout)) | 352 | TIME_AFTER(current_tick, last_charge_time + timeout)) |
353 | { | 353 | { |
354 | power_off(); | 354 | shutdown_hw(); |
355 | } | 355 | } |
356 | } | 356 | } |
357 | else | 357 | else |
@@ -375,7 +375,7 @@ static void handle_auto_poweroff(void) | |||
375 | we cut the power */ | 375 | we cut the power */ |
376 | while(ata_disk_is_active()) | 376 | while(ata_disk_is_active()) |
377 | sleep(HZ); | 377 | sleep(HZ); |
378 | power_off(); | 378 | shutdown_hw(); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | } | 381 | } |
@@ -874,3 +874,18 @@ void powermgmt_init(void) | |||
874 | 874 | ||
875 | #endif /* SIMULATOR */ | 875 | #endif /* SIMULATOR */ |
876 | 876 | ||
877 | void shutdown_hw(void) { | ||
878 | mpeg_stop(); | ||
879 | ata_flush(); | ||
880 | ata_spindown(1); | ||
881 | while(ata_disk_is_active()) | ||
882 | sleep(HZ/10); | ||
883 | |||
884 | mp3_shutdown(); | ||
885 | #if CONFIG_KEYPAD == ONDIO_PAD | ||
886 | backlight_off(); | ||
887 | sleep(1); | ||
888 | lcd_set_contrast(0); | ||
889 | #endif | ||
890 | power_off(); | ||
891 | } | ||