1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 05:31:24 +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 havePassword = true;
bool haveSSID = true; bool haveSSID = true;
bool wifiUp = false; bool wifiUp = false;
uint8_t tries = 40;
// tests // tests
// enableCoreWDT(1); // enableCoreWDT(1);
@ -92,8 +93,9 @@ bool WifiESP::setup(const char *SSid,
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.setAutoReconnect(true); WiFi.setAutoReconnect(true);
WiFi.begin(SSid, password); WiFi.begin(SSid, password);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED && tries) {
Serial.print('.'); Serial.print('.');
tries--;
delay(500); delay(500);
} }
if (WiFi.status() == WL_CONNECTED) { if (WiFi.status() == WL_CONNECTED) {