1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

Disable autopoweroff if charger connected.

This commit is contained in:
Dmitry422
2025-01-17 13:01:38 +07:00
parent 0a2b47c7e1
commit fbc29f519f

View File

@@ -441,13 +441,12 @@ static void power_auto_poweroff_timer_callback(void* context) {
furi_assert(context);
Power* power = context;
//poweroff if not charging now or if connected to charger and charging done
if(((!furi_hal_power_is_charging())) || (furi_hal_power_is_charging_done())) {
power_off(power);
} else {
//else we dont poweroff device and restart timer
//Dont poweroff device if charger connected
if (furi_hal_power_is_charging()) {
FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging");
power_start_auto_poweroff_timer(power);
} else {
power_off(power);
}
}