diff --git a/ampel-firmware/wifi_util.cpp b/ampel-firmware/wifi_util.cpp index 1c86ff50f6cba6e6338ba0201700661413eabf21..2252e6ff951f978be983031e5a3c06b8df29ea03 100644 --- a/ampel-firmware/wifi_util.cpp +++ b/ampel-firmware/wifi_util.cpp @@ -19,8 +19,17 @@ namespace wifi { return WiFi.status() == WL_CONNECTED; } + /* + * Connection attempt, called in blocking mode by setup(). This way, LED effects can be shown + * without needing callbacks, but only during wifi_timeout seconds. + * If connection fails, access point will be started indefinitely, and corresponding + * LED effects will be shown during 5 seconds. + * + * Afterwards, the non-blocking web_config::update() will be called inside loop, and the ampel + * can display CO2 levels. + */ void tryConnection() { - for (int i = 0; i <= config::wifi_timeout + 10; i++) { + for (int i = 0; i <= config::wifi_timeout + 5; i++) { web_config::update(); if (WiFi.getMode() == WIFI_AP){ led_effects::alert(0x1cff68);