diff options
-rw-r--r-- | firmware/powermgmt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 8913c99aad..79a7a90a2b 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -831,15 +831,17 @@ void handle_auto_poweroff(void) | |||
831 | int audio_stat = audio_status(); | 831 | int audio_stat = audio_status(); |
832 | long tick = current_tick; | 832 | long tick = current_tick; |
833 | 833 | ||
834 | #if CONFIG_CHARGING | ||
835 | /* | 834 | /* |
836 | * Inhibit shutdown as long as the charger is plugged in. If it is | 835 | * Inhibit shutdown as long as the charger is plugged in. If it is |
837 | * unplugged, wait for a timeout period and then shut down. | 836 | * unplugged, wait for a timeout period and then shut down. |
838 | */ | 837 | */ |
839 | if (charger_input_state == CHARGER || audio_stat == AUDIO_STATUS_PLAY) { | 838 | if (audio_stat == AUDIO_STATUS_PLAY |
839 | #if CONFIG_CHARGING | ||
840 | || charger_input_state == CHARGER | ||
841 | #endif | ||
842 | ) { | ||
840 | last_event_tick = current_tick; | 843 | last_event_tick = current_tick; |
841 | } | 844 | } |
842 | #endif | ||
843 | 845 | ||
844 | #if !(CONFIG_PLATFORM & PLATFORM_HOSTED) | 846 | #if !(CONFIG_PLATFORM & PLATFORM_HOSTED) |
845 | if (!shutdown_timeout && query_force_shutdown()) { | 847 | if (!shutdown_timeout && query_force_shutdown()) { |