summaryrefslogtreecommitdiffstats
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index e455127496..95763dc950 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -500,6 +500,12 @@ static void power_thread_rtc_process(void)
/* switch off unit if battery level is too low for reliable operation */
bool query_force_shutdown(void)
{
+#if CONFIG_CHARGING
+ /* It doesn't make sense to force shutdown when externally powered. */
+ if (power_input_present())
+ return false;
+#endif
+
#if defined(NO_LOW_BATTERY_SHUTDOWN)
return false;
#elif CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE