@@ -329,38 +329,28 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
329
329
WS._multiNetworks [i].pass );
330
330
}
331
331
}
332
- // add default network
333
- if (_wifiMulti.existsAP (_ssid) == false ) {
334
- _wifiMulti.addAP (_ssid, _pass);
335
- }
336
- long startRetry = millis ();
337
- WS_DEBUG_PRINTLN (" CONNECTING" );
338
- while (_wifiMulti.run (5000 ) != WL_CONNECTED &&
339
- millis () - startRetry < 10000 ) {
340
- // ESP8266 WDT requires yield() during a busy-loop so it doesn't bite
341
- yield ();
342
- }
343
- if (WiFi.status () == WL_CONNECTED) {
344
- _status = WS_NET_CONNECTED;
345
- } else {
346
- _status = WS_NET_DISCONNECTED;
347
- }
332
+ }
333
+
334
+ // add default network
335
+ if (_wifiMulti.existsAP (_ssid) == false ) {
336
+ _wifiMulti.addAP (_ssid, _pass);
337
+ }
338
+
339
+ long startRetry = millis ();
340
+ WS_DEBUG_PRINTLN (" CONNECTING" );
341
+
342
+ while (_wifiMulti.run (5000 ) != WL_CONNECTED &&
343
+ millis () - startRetry < 10000 ) {
344
+ // ESP8266 WDT requires yield() during a busy-loop so it doesn't bite
345
+ yield ();
346
+ }
347
+
348
+ if (WiFi.status () == WL_CONNECTED) {
349
+ _status = WS_NET_CONNECTED;
348
350
} else {
349
- // single network mode
350
-
351
- // wait for a connection to be established
352
- long startRetry = millis ();
353
- WS_DEBUG_PRINTLN (" CONNECTING" );
354
- while (WiFi.status () != WL_CONNECTED && millis () - startRetry < 10000 ) {
355
- // ESP8266 WDT requires yield() during a busy-loop so it doesn't bite
356
- yield ();
357
- }
358
- if (WiFi.status () == WL_CONNECTED) {
359
- _status = WS_NET_CONNECTED;
360
- } else {
361
- _status = WS_NET_DISCONNECTED;
362
- }
351
+ _status = WS_NET_DISCONNECTED;
363
352
}
353
+
364
354
WS.feedWDT ();
365
355
}
366
356
}
0 commit comments