mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
Fix issue when WiFi.begin(ssid, pass) is called right after WiFi.mode(WIFI_OFF)
If ssid and pass matched the values in flash, wifi_station_connect was not called and no connection was attempted
This commit is contained in:
@ -134,9 +134,8 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
|
|||||||
wifi_station_get_config(¤t_conf);
|
wifi_station_get_config(¤t_conf);
|
||||||
if(sta_config_equal(current_conf, conf)) {
|
if(sta_config_equal(current_conf, conf)) {
|
||||||
DEBUGV("sta config unchanged");
|
DEBUGV("sta config unchanged");
|
||||||
return status();
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
ETS_UART_INTR_DISABLE();
|
ETS_UART_INTR_DISABLE();
|
||||||
|
|
||||||
if(WiFi._persistent) {
|
if(WiFi._persistent) {
|
||||||
@ -150,10 +149,13 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
|
|||||||
wifi_station_set_config_current(&conf);
|
wifi_station_set_config_current(&conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ETS_UART_INTR_ENABLE();
|
||||||
|
}
|
||||||
|
|
||||||
|
ETS_UART_INTR_DISABLE();
|
||||||
if(connect) {
|
if(connect) {
|
||||||
wifi_station_connect();
|
wifi_station_connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
ETS_UART_INTR_ENABLE();
|
ETS_UART_INTR_ENABLE();
|
||||||
|
|
||||||
if(channel > 0 && channel <= 13) {
|
if(channel > 0 && channel <= 13) {
|
||||||
|
Reference in New Issue
Block a user