diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cd712e69..1e90cc61b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,7 @@ - Desktop: - Fallback Poweroff prompt when power settings is unavailable (by @Willy-JL) - Sub-GHz: Fix GPS "Latitute" typo, switch to "Lat" and "Lon" in .sub files (#246 by @m7i-org) +- Power: Suppress Shutdown on Idle While Charging / Plugged In (#244 by @luu176) - Storage: - Fallback SD format prompt when storage settings is unavailable (by @Willy-JL) - OFW: Fix folder rename fails (by @portasynthinca3) diff --git a/applications/services/power/power_service/power.c b/applications/services/power/power_service/power.c index 987bb6861d..ba8e6cd6a7 100644 --- a/applications/services/power/power_service/power.c +++ b/applications/services/power/power_service/power.c @@ -333,8 +333,15 @@ static void power_storage_callback(const void* message, void* context) { static void power_auto_shutdown_timer_callback(void* context) { furi_assert(context); Power* power = context; - power_auto_shutdown_inhibit(power); - power_off(power); + + // Suppress shutdown on idle while charging to avoid the battery from not charging fully. Then restart timer back to original timeout. + if(power->state != PowerStateNotCharging) { + FURI_LOG_D(TAG, "Plugged in, reset idle timer"); + power_auto_shutdown_arm(power); + } else { + power_auto_shutdown_inhibit(power); + power_off(power); + } } static void power_apply_settings(Power* power) {