From b7b28eadecc5fd14f107e2605dbbcfe98cf46df8 Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Fri, 21 Sep 2018 21:34:52 -0700 Subject: [PATCH] reset .last at the start of main_loop NOTE this maybe unnceccesary as this get initd to 0 in _add_ap if .last is -1 at that point --- main/esp32-wifi-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c index eefaa49..e907efb 100644 --- a/main/esp32-wifi-manager.c +++ b/main/esp32-wifi-manager.c @@ -112,6 +112,8 @@ void wifi_manager_connect() { }; void wifi_manager_main_loop() { + ap_store.last = 0; + while(true) { EventBits_t ev_bits = xEventGroupGetBits(wm_event_group); @@ -120,8 +122,6 @@ void wifi_manager_main_loop() { xEventGroupSetBits(wm_event_group, WIFI_CONNECTING); - ap_store.last = 0; - wifi_manager_connect(); }