Suspend strip during operations

This commit is contained in:
Blaz Kristan
2023-12-22 15:39:07 +01:00
parent 4e105492ca
commit cf3f6ede72
7 changed files with 47 additions and 27 deletions

View File

@@ -289,8 +289,9 @@ void initServer()
#endif
usermods.onUpdateBegin(true); // notify usermods that update is about to begin (some may require task de-init)
lastEditTime = millis(); // make sure PIN does not lock during update
strip.suspend();
#ifdef ESP8266
strip.purgeSegments(true); // free as much memory as you can
strip.resetSegments(); // free as much memory as you can
Update.runAsync(true);
#endif
Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000);
@@ -301,6 +302,7 @@ void initServer()
DEBUG_PRINTLN(F("Update Success"));
} else {
DEBUG_PRINTLN(F("Update Failed"));
strip.resume();
usermods.onUpdateBegin(false); // notify usermods that update has failed (some may require task init)
#if WLED_WATCHDOG_TIMEOUT > 0
WLED::instance().enableWatchdog();