diff options
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 88fc5e8e33..a31acbcf0b 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -266,7 +266,7 @@ static const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | |||
266 | #endif | 266 | #endif |
267 | }; | 267 | }; |
268 | 268 | ||
269 | #ifdef CONFIG_CHARGING | 269 | #if CONFIG_CHARGING |
270 | charger_input_state_type charger_input_state IDATA_ATTR; | 270 | charger_input_state_type charger_input_state IDATA_ATTR; |
271 | 271 | ||
272 | 272 | ||
@@ -545,7 +545,7 @@ static void battery_status_update(void) | |||
545 | / 100 / (CURRENT_MAX_CHG - runcurrent()); | 545 | / 100 / (CURRENT_MAX_CHG - runcurrent()); |
546 | } | 546 | } |
547 | else | 547 | else |
548 | #elif defined(CONFIG_CHARGING) && CONFIG_BATTERY == BATT_LIPOL1300 | 548 | #elif CONFIG_CHARGING && CONFIG_BATTERY == BATT_LIPOL1300 |
549 | if (charger_inserted()) { | 549 | if (charger_inserted()) { |
550 | #ifdef IRIVER_H300_SERIES | 550 | #ifdef IRIVER_H300_SERIES |
551 | /* H300_SERIES use CURRENT_MAX_CHG for basic charge time (80%) | 551 | /* H300_SERIES use CURRENT_MAX_CHG for basic charge time (80%) |
@@ -612,7 +612,7 @@ static void handle_auto_poweroff(void) | |||
612 | long timeout = poweroff_idle_timeout_value[poweroff_timeout]*60*HZ; | 612 | long timeout = poweroff_idle_timeout_value[poweroff_timeout]*60*HZ; |
613 | int audio_stat = audio_status(); | 613 | int audio_stat = audio_status(); |
614 | 614 | ||
615 | #ifdef CONFIG_CHARGING | 615 | #if CONFIG_CHARGING |
616 | /* | 616 | /* |
617 | * Inhibit shutdown as long as the charger is plugged in. If it is | 617 | * Inhibit shutdown as long as the charger is plugged in. If it is |
618 | * unplugged, wait for a timeout period and then shut down. | 618 | * unplugged, wait for a timeout period and then shut down. |
@@ -656,7 +656,7 @@ static void handle_auto_poweroff(void) | |||
656 | if(TIME_AFTER(current_tick, sleeptimer_endtick)) | 656 | if(TIME_AFTER(current_tick, sleeptimer_endtick)) |
657 | { | 657 | { |
658 | audio_stop(); | 658 | audio_stop(); |
659 | #if defined(CONFIG_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING) | 659 | #if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) |
660 | if((charger_input_state == CHARGER) || | 660 | if((charger_input_state == CHARGER) || |
661 | (charger_input_state == CHARGER_PLUGGED)) | 661 | (charger_input_state == CHARGER_PLUGGED)) |
662 | { | 662 | { |
@@ -751,7 +751,7 @@ static void power_thread_sleep(int ticks) | |||
751 | 751 | ||
752 | while (ticks > 0) { | 752 | while (ticks > 0) { |
753 | 753 | ||
754 | #ifdef CONFIG_CHARGING | 754 | #if CONFIG_CHARGING |
755 | /* | 755 | /* |
756 | * Detect charger plugged/unplugged transitions. On a plugged or | 756 | * Detect charger plugged/unplugged transitions. On a plugged or |
757 | * unplugged event, we return immediately, run once through the main | 757 | * unplugged event, we return immediately, run once through the main |
@@ -761,7 +761,7 @@ static void power_thread_sleep(int ticks) | |||
761 | if(charger_inserted() | 761 | if(charger_inserted() |
762 | #ifdef HAVE_USB_POWER /* USB powered or USB inserted both provide power */ | 762 | #ifdef HAVE_USB_POWER /* USB powered or USB inserted both provide power */ |
763 | || usb_powered() | 763 | || usb_powered() |
764 | #ifdef CONFIG_CHARGING | 764 | #if CONFIG_CHARGING |
765 | || (usb_inserted() && usb_charging_enabled()) | 765 | || (usb_inserted() && usb_charging_enabled()) |
766 | #endif | 766 | #endif |
767 | #endif | 767 | #endif |
@@ -924,7 +924,7 @@ static void power_thread(void) | |||
924 | avgbat = avgbat * BATT_AVE_SAMPLES; | 924 | avgbat = avgbat * BATT_AVE_SAMPLES; |
925 | battery_centivolts = avgbat / BATT_AVE_SAMPLES / 10000; | 925 | battery_centivolts = avgbat / BATT_AVE_SAMPLES / 10000; |
926 | 926 | ||
927 | #ifdef CONFIG_CHARGING | 927 | #if CONFIG_CHARGING |
928 | if(charger_inserted()) { | 928 | if(charger_inserted()) { |
929 | battery_percent = voltage_to_percent(battery_centivolts, | 929 | battery_percent = voltage_to_percent(battery_centivolts, |
930 | percent_to_volt_charge); | 930 | percent_to_volt_charge); |