Disable wifi modem sleep on ESP32-C3 if possible

This commit is contained in:
Theo Arends 2021-07-05 12:32:58 +02:00
parent d362b494b8
commit d5585adbb2

View File

@ -164,7 +164,12 @@ void WiFiSetSleepMode(void)
WiFi.setSleepMode(WIFI_NONE_SLEEP); // Disable sleep
}
} else {
if (Settings->flag3.sleep_normal) { // SetOption60 - Enable normal sleep instead of dynamic sleep
#ifdef CONFIG_IDF_TARGET_ESP32C3
if (!TasmotaGlobal.wifi_stay_asleep) {
WiFi.setSleepMode(WIFI_NONE_SLEEP); // Disable sleep
} else
#endif
if (Settings->flag3.sleep_normal) { // SetOption60 - Enable normal sleep instead of dynamic sleep
WiFi.setSleepMode(WIFI_LIGHT_SLEEP); // Allow light sleep during idle times
} else {
WiFi.setSleepMode(WIFI_MODEM_SLEEP); // Sleep (Esp8288/Arduino core and sdk default)