1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +01:00

give up eventually

This commit is contained in:
Harald Barth 2021-11-02 17:50:32 +01:00
parent 837b0a9fb6
commit 77ee57eb83

View File

@ -77,6 +77,7 @@ bool WifiESP::setup(const char *SSid,
bool havePassword = true;
bool haveSSID = true;
bool wifiUp = false;
uint8_t tries = 40;
// tests
// enableCoreWDT(1);
@ -92,8 +93,9 @@ bool WifiESP::setup(const char *SSid,
WiFi.mode(WIFI_STA);
WiFi.setAutoReconnect(true);
WiFi.begin(SSid, password);
while (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED && tries) {
Serial.print('.');
tries--;
delay(500);
}
if (WiFi.status() == WL_CONNECTED) {