@@ -183,22 +183,22 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
183
183
DEBUGV (" sta config unchanged" );
184
184
}
185
185
else {
186
- ETS_UART_INTR_DISABLE ();
186
+ ETS_INTR_LOCK ();
187
187
188
188
if (WiFi._persistent ) {
189
189
wifi_station_set_config (&conf);
190
190
} else {
191
191
wifi_station_set_config_current (&conf);
192
192
}
193
193
194
- ETS_UART_INTR_ENABLE ();
194
+ ETS_INTR_UNLOCK ();
195
195
}
196
196
197
- ETS_UART_INTR_DISABLE ();
197
+ ETS_INTR_LOCK ();
198
198
if (connect) {
199
199
wifi_station_connect ();
200
200
}
201
- ETS_UART_INTR_ENABLE ();
201
+ ETS_INTR_UNLOCK ();
202
202
203
203
if (channel > 0 && channel <= 13 ) {
204
204
wifi_set_channel (channel);
@@ -230,9 +230,9 @@ wl_status_t ESP8266WiFiSTAClass::begin() {
230
230
return WL_CONNECT_FAILED;
231
231
}
232
232
233
- ETS_UART_INTR_DISABLE ();
233
+ ETS_INTR_LOCK ();
234
234
wifi_station_connect ();
235
- ETS_UART_INTR_ENABLE ();
235
+ ETS_INTR_UNLOCK ();
236
236
237
237
if (!_useStaticIp) {
238
238
wifi_station_dhcpc_start ();
@@ -380,14 +380,14 @@ bool ESP8266WiFiSTAClass::disconnect(bool wifioff) {
380
380
else
381
381
ret = true ;
382
382
383
- ETS_UART_INTR_DISABLE ();
383
+ ETS_INTR_LOCK ();
384
384
if (WiFi._persistent ) {
385
385
wifi_station_set_config (&conf);
386
386
} else {
387
387
wifi_station_set_config_current (&conf);
388
388
}
389
389
390
- ETS_UART_INTR_ENABLE ();
390
+ ETS_INTR_UNLOCK ();
391
391
392
392
if (wifioff) {
393
393
WiFi.enableSTA (false );
@@ -413,9 +413,9 @@ bool ESP8266WiFiSTAClass::isConnected() {
413
413
*/
414
414
bool ESP8266WiFiSTAClass::setAutoConnect (bool autoConnect) {
415
415
bool ret;
416
- ETS_UART_INTR_DISABLE ();
416
+ ETS_INTR_LOCK ();
417
417
ret = wifi_station_set_auto_connect (autoConnect);
418
- ETS_UART_INTR_ENABLE ();
418
+ ETS_INTR_UNLOCK ();
419
419
return ret;
420
420
}
421
421
0 commit comments