Use safer ESP.restart() instead of ESP.reset() to reboot the ESP

https://github.com/esp8266/Arduino/issues/1722#issuecomment-192624783
This commit is contained in:
Lomanic 2020-06-13 17:57:19 +02:00
parent f13018e93b
commit f5b347b3b1
1 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ void handleAdmin() {
httpServer.sendHeader("Location", httpServer.uri(), true);
httpServer.send(302, "text/plain", "");
delay(500);
ESP.reset();
ESP.restart();
return;
}
}
@ -268,7 +268,7 @@ void setup() {
Serial.println(F("failed to connect and hit timeout"));
delay(3000);
//reset and try again, or maybe put it to deep sleep
ESP.reset();
ESP.restart();
delay(5000);
}
@ -343,7 +343,7 @@ void loop() {
wifiManager.resetSettings();
SPIFFS.format();
delay(500);
ESP.reset();
ESP.restart();
}
unsigned long currentMillis = millis();
if (currentMillis - previousMillis > notifyInterval) {