Skip to content

Commit

Permalink
Immediately go to sleep if battery is critical
Browse files Browse the repository at this point in the history
  • Loading branch information
SZenglein authored and Sascha committed Dec 4, 2023
1 parent 8407213 commit d360af9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ void Battery_Init(void) {

Log_Println(batteryCriticalMsg, LOGLEVEL_NOTICE);
// Power down and enter deepsleep
System_RequestSleep();
// Don't call System_RequestSleep() here: If the battery is critial, we want to avoid as much init work as possible
// and also any blinking lights or sounds. The goal is to just stay off.
// Additionally, LPCD will not be enabled. This is intentional to avoid battery drain.
delay(200);
esp_deep_sleep_start();
}
#endif
}
Expand Down

0 comments on commit d360af9

Please sign in to comment.