Don't powersave on Wifi (#5443)

* Don't go into light sleep with wifi enabled

* Move

* Trunk
pull/5444/head
Ben Meadors 2024-11-25 06:53:05 -06:00 zatwierdzone przez GitHub
rodzic 7c2b6778cb
commit 58c957f2c7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -19,6 +19,10 @@
#include "sleep.h"
#include "target_specific.h"
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
#include "mesh/wifi/WiFiAPClient.h"
#endif
#ifndef SLEEP_TIME
#define SLEEP_TIME 30
#endif
@ -377,9 +381,9 @@ void PowerFSM_setup()
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
#ifdef ARCH_ESP32
// See: https://github.com/meshtastic/firmware/issues/1071
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiated through the
// modules
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
// Don't add power saving transitions if we are a power saving tracker or sensor or have Wifi enabled. Sleep will be initiated
// through the modules
if ((isRouter || config.power.is_power_saving) && !isWifiAvailable() && !isTrackerOrSensor) {
powerFSM.add_timed_transition(&stateNB, &stateLS,
Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
"Min wake timeout");