Skip to content

Commit

Permalink
Disable autopoweroff if charger connected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry422 committed Jan 17, 2025
1 parent 0a2b47c commit fbc29f5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions applications/services/power/power_service/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit fbc29f5

Please sign in to comment.