mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 03:29:17 +00:00
implement lower cap on power thread interval
This commit is contained in:
parent
7d695c4aae
commit
9696546458
@ -963,12 +963,20 @@ int32_t Power::runOnce()
|
||||
#ifdef ARCH_ESP32
|
||||
int Power::beforeLightSleep(void *unused)
|
||||
{
|
||||
setInterval(config.power.ls_secs * 1000UL);
|
||||
// ensure we won't run the thread when light sleeping
|
||||
unsigned long interval = config.power.ls_secs;
|
||||
|
||||
if (interval < 20) {
|
||||
interval = 20;
|
||||
}
|
||||
|
||||
setInterval(interval * 1000UL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Power::afterLightSleep(esp_sleep_wakeup_cause_t cause)
|
||||
{
|
||||
// restore default thread interval after light sleep
|
||||
setInterval(20 * 1000UL);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user