1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-03 07:02:28 +03:00

Prevent WiFi config corruption (#1997 #1856 #1699 #1675)

This commit is contained in:
Ivan Grokhotkov 2016-05-10 15:27:06 +08:00
parent 61cc420cb8
commit f2fb43cabf

View File

@ -140,6 +140,11 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
ETS_UART_INTR_DISABLE();
if(WiFi._persistent) {
// workaround for #1997: make sure the value of ap_number is updated and written to flash
// to be removed after SDK update
wifi_station_ap_number_set(2);
wifi_station_ap_number_set(1);
wifi_station_set_config(&conf);
} else {
wifi_station_set_config_current(&conf);