diff options
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 6e0c03c94a..6f0c37b3c7 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "adc.h" | 29 | #include "adc.h" |
30 | #include "string.h" | 30 | #include "string.h" |
31 | #include "sprintf.h" | 31 | #include "sprintf.h" |
32 | #include "ata.h" | 32 | #include "storage.h" |
33 | #include "power.h" | 33 | #include "power.h" |
34 | #include "button.h" | 34 | #include "button.h" |
35 | #include "audio.h" | 35 | #include "audio.h" |
@@ -451,7 +451,7 @@ static void handle_auto_poweroff(void) | |||
451 | !sleeptimer_active))) | 451 | !sleeptimer_active))) |
452 | { | 452 | { |
453 | if(TIME_AFTER(current_tick, last_event_tick + timeout) && | 453 | if(TIME_AFTER(current_tick, last_event_tick + timeout) && |
454 | TIME_AFTER(current_tick, last_disk_activity + timeout)) | 454 | TIME_AFTER(current_tick, storage_last_disk_activity() + timeout)) |
455 | { | 455 | { |
456 | sys_poweroff(); | 456 | sys_poweroff(); |
457 | } | 457 | } |
@@ -579,7 +579,7 @@ int pid_i = 0; /* PID integral term */ | |||
579 | 579 | ||
580 | static inline void charging_algorithm_small_step(void) | 580 | static inline void charging_algorithm_small_step(void) |
581 | { | 581 | { |
582 | if (ata_disk_is_active()) { | 582 | if (storage_disk_is_active()) { |
583 | /* flag hdd use for charging calculation */ | 583 | /* flag hdd use for charging calculation */ |
584 | disk_activity_last_cycle = true; | 584 | disk_activity_last_cycle = true; |
585 | } | 585 | } |
@@ -589,7 +589,7 @@ static inline void charging_algorithm_small_step(void) | |||
589 | * If we have a lot of pending writes or if the disk is spining, | 589 | * If we have a lot of pending writes or if the disk is spining, |
590 | * fsync the debug log file. | 590 | * fsync the debug log file. |
591 | */ | 591 | */ |
592 | if((wrcount > 10) || ((wrcount > 0) && ata_disk_is_active())) { | 592 | if((wrcount > 10) || ((wrcount > 0) && storage_disk_is_active())) { |
593 | fsync(fd); | 593 | fsync(fd); |
594 | wrcount = 0; | 594 | wrcount = 0; |
595 | } | 595 | } |
@@ -1014,7 +1014,7 @@ static void power_thread_sleep(int ticks) | |||
1014 | * the disk is spinning unless we are in USB mode (the disk will most | 1014 | * the disk is spinning unless we are in USB mode (the disk will most |
1015 | * likely always be spinning in USB mode). | 1015 | * likely always be spinning in USB mode). |
1016 | */ | 1016 | */ |
1017 | if (!ata_disk_is_active() || usb_inserted()) { | 1017 | if (!storage_disk_is_active() || usb_inserted()) { |
1018 | avgbat += battery_adc_voltage() - (avgbat / BATT_AVE_SAMPLES); | 1018 | avgbat += battery_adc_voltage() - (avgbat / BATT_AVE_SAMPLES); |
1019 | /* | 1019 | /* |
1020 | * battery_millivolts is the millivolt-scaled filtered battery value. | 1020 | * battery_millivolts is the millivolt-scaled filtered battery value. |
@@ -1152,10 +1152,10 @@ void shutdown_hw(void) | |||
1152 | #ifdef HAVE_LCD_BITMAP | 1152 | #ifdef HAVE_LCD_BITMAP |
1153 | glyph_cache_save(); | 1153 | glyph_cache_save(); |
1154 | #endif | 1154 | #endif |
1155 | if(ata_disk_is_active()) | 1155 | if(storage_disk_is_active()) |
1156 | ata_spindown(1); | 1156 | storage_spindown(1); |
1157 | } | 1157 | } |
1158 | while(ata_disk_is_active()) | 1158 | while(storage_disk_is_active()) |
1159 | sleep(HZ/10); | 1159 | sleep(HZ/10); |
1160 | 1160 | ||
1161 | #if CONFIG_CODEC != SWCODEC | 1161 | #if CONFIG_CODEC != SWCODEC |
@@ -1166,7 +1166,7 @@ void shutdown_hw(void) | |||
1166 | 1166 | ||
1167 | /* If HD is still active we try to wait for spindown, otherwise the | 1167 | /* If HD is still active we try to wait for spindown, otherwise the |
1168 | shutdown_timeout in power_thread_sleep will force a power off */ | 1168 | shutdown_timeout in power_thread_sleep will force a power off */ |
1169 | while(ata_disk_is_active()) | 1169 | while(storage_disk_is_active()) |
1170 | sleep(HZ/10); | 1170 | sleep(HZ/10); |
1171 | #ifndef IAUDIO_X5 | 1171 | #ifndef IAUDIO_X5 |
1172 | lcd_set_contrast(0); | 1172 | lcd_set_contrast(0); |