Skip to content

Commit

Permalink
Fix output glitches when playlist changes preset (#4442)
Browse files Browse the repository at this point in the history
same issue as with #4386
waiting on bus to finish updating before file access fixes the glitches.
this issue is only present on S2 and C3, not on ESP8266 or dual-core ESPs, the fix is only applied for these two.
  • Loading branch information
DedeHai committed Jan 12, 2025
1 parent a265318 commit c9b95e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wled00/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ void handlePresets()

DEBUG_PRINTF_P(PSTR("Applying preset: %u\n"), (unsigned)tmpPreset);

#if defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3)
unsigned long start = millis();
while (strip.isUpdating() && millis() - start < FRAMETIME_FIXED) yield(); // wait for strip to finish updating, accessing FS during sendout causes glitches
#endif

#ifdef ARDUINO_ARCH_ESP32
if (tmpPreset==255 && tmpRAMbuffer!=nullptr) {
deserializeJson(*pDoc,tmpRAMbuffer);
Expand Down

0 comments on commit c9b95e2

Please sign in to comment.