mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-31 02:45:41 +00:00
implement lower cap on power thread interval
This commit is contained in:
parent
07804e1efa
commit
4dddfa3cbb
@ -889,12 +889,20 @@ int32_t Power::runOnce()
|
|||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
int Power::beforeLightSleep(void *unused)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Power::afterLightSleep(esp_sleep_wakeup_cause_t cause)
|
int Power::afterLightSleep(esp_sleep_wakeup_cause_t cause)
|
||||||
{
|
{
|
||||||
|
// restore default thread interval after light sleep
|
||||||
setInterval(20 * 1000UL);
|
setInterval(20 * 1000UL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user