move CONNECTING bitsetting to _connect and reset _IDLE
This commit is contained in:
parent
7e6c9036b4
commit
2dc81950d4
1 changed files with 4 additions and 3 deletions
|
@ -106,7 +106,10 @@ void wifi_manager_connect() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ESP_LOGI(TAG, "connecting to AP %d of %d", ap_store.last, ap_store.count);
|
xEventGroupSetBits(wm_event_group, WIFI_CONNECTING);
|
||||||
|
xEventGroupClearBits(wm_event_group, WIFI_IDLE);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "connecting to AP %d of %d", ap_store.last + 1, ap_store.count);
|
||||||
|
|
||||||
memcpy((char *)&wifi_config.sta.ssid, ap_store.aps[ap_store.last].ssid, strlen(ap_store.aps[ap_store.last].ssid) + 1);
|
memcpy((char *)&wifi_config.sta.ssid, ap_store.aps[ap_store.last].ssid, strlen(ap_store.aps[ap_store.last].ssid) + 1);
|
||||||
memcpy((char *)&wifi_config.sta.password, ap_store.aps[ap_store.last].password, strlen(ap_store.aps[ap_store.last].password) + 1);
|
memcpy((char *)&wifi_config.sta.password, ap_store.aps[ap_store.last].password, strlen(ap_store.aps[ap_store.last].password) + 1);
|
||||||
|
@ -131,8 +134,6 @@ void wifi_manager_main_loop() {
|
||||||
if(ev_bits & AP_AVAILABLE && (ev_bits & WIFI_CONNECTING) == 0) {
|
if(ev_bits & AP_AVAILABLE && (ev_bits & WIFI_CONNECTING) == 0) {
|
||||||
ESP_LOGI(TAG, "AP Available, starting WiFi connect");
|
ESP_LOGI(TAG, "AP Available, starting WiFi connect");
|
||||||
|
|
||||||
xEventGroupSetBits(wm_event_group, WIFI_CONNECTING);
|
|
||||||
|
|
||||||
wifi_manager_connect();
|
wifi_manager_connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue