swap SCANNING/IDLE bits weather ap found or not

This commit is contained in:
Morgan 'ARR\!' Allen 2018-10-11 13:48:16 -07:00
parent ccffb2229f
commit f1ff7079fa

View file

@ -102,10 +102,11 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) {
}
found:
xEventGroupClearBits(wm_event_group, WIFI_SCANNING);
xEventGroupSetBits(wm_event_group, WIFI_IDLE);
if(ap_store.last != -1) {
ESP_LOGI(TAG, "Got matching ESSID: %s", ap_store.aps[ap_store.last].ssid);
xEventGroupClearBits(wm_event_group, WIFI_SCANNING);
xEventGroupSetBits(wm_event_group, WIFI_IDLE);
wifi_manager_connect();
} else {