Skip to content

Commit

Permalink
Fallback in case of sleepTimeout is set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausMu committed Jun 9, 2024
1 parent 9966a8f commit cbeacbb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Platformio/hardware/ESP32/sleep_hal_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ uint32_t get_sleepTimeout_HAL() {
}
void set_sleepTimeout_HAL(uint32_t aSleepTimeout) {
sleepTimeout = aSleepTimeout;
// For reason unknown, some users reported sleepTimeout was set to 0. In this case device would immediately go to sleep. Prevent this.
if (sleepTimeout == 0) {
sleepTimeout = DEFAULT_SLEEP_TIMEOUT;
}
}
bool get_wakeupByIMUEnabled_HAL() {
return wakeupByIMUEnabled;
Expand Down

0 comments on commit cbeacbb

Please sign in to comment.