Skip to content

Commit

Permalink
ota: disable async mode when running arduino_ota
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Sep 19, 2019
1 parent 4924212 commit 96ada44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/espurna/ota_arduinoota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ void _arduinoOtaOnStart() {
// Disabling EEPROM rotation to prevent writing to EEPROM after the upgrade
eepromRotate(false);

// Avoid triggering wdt on write operations, allow implicit yield() calls
// (async mode could be enabled when using ota_base methods, currently used by web and asynctcp ota)
Update.runAsync(false);

// Because ArduinoOTA is synchronous, force backup right now instead of waiting for the next loop()
eepromBackup(0);

Expand All @@ -55,7 +59,7 @@ void _arduinoOtaOnEnd() {
void _arduinoOtaOnProgress(unsigned int progress, unsigned int total) {

// Removed to avoid websocket ping back during upgrade (see #1574)
// TODO: implement as separate from debugging message
// TODO: implement as percentage progress message, separate from debug log?
#if WEB_SUPPORT
if (wsConnected()) return;
#endif
Expand Down

0 comments on commit 96ada44

Please sign in to comment.