Skip to content

Commit c9b95e2

Browse files
committed
Fix output glitches when playlist changes preset (#4442)
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.
1 parent a265318 commit c9b95e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wled00/presets.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ void handlePresets()
164164

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

167+
#if defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3)
168+
unsigned long start = millis();
169+
while (strip.isUpdating() && millis() - start < FRAMETIME_FIXED) yield(); // wait for strip to finish updating, accessing FS during sendout causes glitches
170+
#endif
171+
167172
#ifdef ARDUINO_ARCH_ESP32
168173
if (tmpPreset==255 && tmpRAMbuffer!=nullptr) {
169174
deserializeJson(*pDoc,tmpRAMbuffer);

0 commit comments

Comments
 (0)