Watchdog: disable watchdog while OTA is running

This commit is contained in:
Daniel Poelzleithner
2022-05-23 22:30:13 +00:00
parent 213e3e998a
commit 26fa38d052
3 changed files with 39 additions and 15 deletions

View File

@@ -203,6 +203,7 @@ void initServer()
},[](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){
if(!index){
DEBUG_PRINTLN(F("OTA Update Start"));
WLED::instance().disableWatchdog();
#ifdef ESP8266
Update.runAsync(true);
#endif
@@ -214,6 +215,7 @@ void initServer()
DEBUG_PRINTLN(F("Update Success"));
} else {
DEBUG_PRINTLN(F("Update Failed"));
WLED::instance().enableWatchdog();
}
}
});