summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/powermgmt.h1
-rw-r--r--firmware/powermgmt.c19
2 files changed, 18 insertions, 2 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index ce006e9145..922630097a 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -120,5 +120,6 @@ void set_sleep_timer(int seconds);
120int get_sleep_timer(void); 120int get_sleep_timer(void);
121void set_car_adapter_mode(bool setting); 121void set_car_adapter_mode(bool setting);
122void reset_poweroff_timer(void); 122void reset_poweroff_timer(void);
123void shutdown_hw(void);
123 124
124#endif 125#endif
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
877void 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}