From af85295bb226ebb3042f30dfed49d9b8f0048570 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Fri, 31 Dec 2021 09:22:21 +0100 Subject: [PATCH] fix wifi disable --- src/esp_clock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esp_clock.cpp b/src/esp_clock.cpp index 292aab5..6fb0bf5 100644 --- a/src/esp_clock.cpp +++ b/src/esp_clock.cpp @@ -47,9 +47,7 @@ void onWifiConnected() { Serial.println("Wifi connected event"); Wifi::printStatus(); Ota::tLoop.enable(); -#if !WIFI_ALWAYS_ON if (!Ir::avrOn) tCheckWifi.restartDelayed(); -#endif Mqtt::client.connect(); if (time_t newTime = Ntp::updateTime()) { Serial.println(asctime(localtime(&newTime))); @@ -57,10 +55,12 @@ void onWifiConnected() { } void checkWifiCallback() { +#if !WIFI_ALWAYS_ON Serial.println("Wifi connection timed out"); Mqtt::client.disconnect(); Ota::tLoop.disable(); Wifi::disconnect(); +#endif } ICACHE_RAM_ATTR void onButtonPressed() {