mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
Disable autopoweroff if charger connected.
This commit is contained in:
@@ -441,13 +441,12 @@ static void power_auto_poweroff_timer_callback(void* context) {
|
|||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
Power* power = context;
|
Power* power = context;
|
||||||
|
|
||||||
//poweroff if not charging now or if connected to charger and charging done
|
//Dont poweroff device if charger connected
|
||||||
if(((!furi_hal_power_is_charging())) || (furi_hal_power_is_charging_done())) {
|
if (furi_hal_power_is_charging()) {
|
||||||
power_off(power);
|
|
||||||
} else {
|
|
||||||
//else we dont poweroff device and restart timer
|
|
||||||
FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging");
|
FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging");
|
||||||
power_start_auto_poweroff_timer(power);
|
power_start_auto_poweroff_timer(power);
|
||||||
|
} else {
|
||||||
|
power_off(power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user