mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Power: Suppress Shutdown on Idle While Charging / Plugged In (#244)
* Update power.c * Update power.c Co-authored-by: WillyJL <49810075+Willy-JL@users.noreply.github.com> * Update power.c Co-authored-by: WillyJL <49810075+Willy-JL@users.noreply.github.com> * Format * Also restart timer when plugged in but fully charged avoids the 'it is now safe to unplug cable' screen * Update changelog --------- Co-authored-by: WillyJL <49810075+Willy-JL@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user