Fix reboot caused by starting scan while wifi is connecting.

This commit is contained in:
Sebastien
2019-10-28 23:24:14 -04:00
parent e4374f8554
commit ec293f8258

View File

@@ -835,8 +835,14 @@ void wifi_manager( void * pvParameters ){
/* if a scan is already in progress this message is simply ignored thanks to the WIFI_MANAGER_SCAN_BIT uxBit */
uxBits = xEventGroupGetBits(wifi_manager_event_group);
if(! (uxBits & WIFI_MANAGER_SCAN_BIT) ){
xEventGroupSetBits(wifi_manager_event_group, WIFI_MANAGER_SCAN_BIT);
ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, false));
if(esp_wifi_scan_start(&scan_config, false)!=ESP_OK){
ESP_LOGW(TAG,"Unable to start scan; wifi is trying to connect");
// set_status_message(WARNING, "Wifi Connecting. Cannot start scan.");
}
else {
xEventGroupSetBits(wifi_manager_event_group, WIFI_MANAGER_SCAN_BIT);
}
}
/* callback */