make wifi_always_on configurable

This commit is contained in:
Nicu Hodos 2021-12-30 20:58:58 +01:00
parent 4e1696bb65
commit db9cd46ab5
2 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,7 @@ lib_deps =
arkhipenko/TaskScheduler@^3.4.0
adafruit/Adafruit Unified Sensor @ ^1.1.4
adafruit/Adafruit BMP280 Library@^2.5.0
build_flags = -D IR=1
build_flags = -D IR=1 -D WIFI_ALWAYS_ON=1
[env:laptop_home]

View File

@ -47,7 +47,9 @@ 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)));