Fallback in case of sleepTimeout is set to 0

This commit is contained in:
KlausMu 2024-06-09 08:38:34 +02:00
parent 9966a8fba1
commit cbeacbb7ee

View file

@ -238,6 +238,10 @@ uint32_t get_sleepTimeout_HAL() {
} }
void set_sleepTimeout_HAL(uint32_t aSleepTimeout) { void set_sleepTimeout_HAL(uint32_t aSleepTimeout) {
sleepTimeout = 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() { bool get_wakeupByIMUEnabled_HAL() {
return wakeupByIMUEnabled; return wakeupByIMUEnabled;