mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +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:
parent
a14ac2cbdd
commit
b4490cd76d
@ -134,9 +134,8 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
|
||||
wifi_station_get_config(¤t_conf);
|
||||
if(sta_config_equal(current_conf, conf)) {
|
||||
DEBUGV("sta config unchanged");
|
||||
return status();
|
||||
}
|
||||
|
||||
else {
|
||||
ETS_UART_INTR_DISABLE();
|
||||
|
||||
if(WiFi._persistent) {
|
||||
@ -150,10 +149,13 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
|
||||
wifi_station_set_config_current(&conf);
|
||||
}
|
||||
|
||||
ETS_UART_INTR_ENABLE();
|
||||
}
|
||||
|
||||
ETS_UART_INTR_DISABLE();
|
||||
if(connect) {
|
||||
wifi_station_connect();
|
||||
}
|
||||
|
||||
ETS_UART_INTR_ENABLE();
|
||||
|
||||
if(channel > 0 && channel <= 13) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user