WLEDMM_NO_FILEWAIT => WLEDMM_FILEWAIT
reversed the logic, to make it more straight forward.
This commit is contained in:
@@ -50,7 +50,7 @@ void closeFile() {
|
||||
if (!f) {doCloseFile = false; return;} // WLEDMM only do all this hick-hack when f is an open file
|
||||
|
||||
bool oldLock = suspendStripService;
|
||||
#if !defined(WLEDMM_NO_FILEWAIT) // not necessary if we have the flicker-free RMTHI driver
|
||||
#if defined(WLEDMM_FILEWAIT) // only wait if we don't have the flicker-free RMTHI driver
|
||||
unsigned long t_wait = millis();
|
||||
if (strip.isUpdating()) suspendStripService = true; // WLEDMM schedule short pause to prevent LEDs glitching during flash write
|
||||
while(strip.isUpdating() && (millis() - t_wait < 72)) delay(1); // WLEDMM try to catch a moment when strip is idle
|
||||
@@ -550,7 +550,7 @@ bool handleFileRead(AsyncWebServerRequest* request, String path){
|
||||
#endif
|
||||
|
||||
// wait for strip to finish updating, accessing FS during sendout causes glitches
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(WLEDMM_NO_FILEWAIT) // not necessary if we have the flicker-free RMTHI driver
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_FILEWAIT) // only wait if we don't have the flicker-free RMTHI driver
|
||||
unsigned wait_start = millis();
|
||||
while (strip.isUpdating() && (millis() - wait_start < 40)) delay(1); // wait max 40ms
|
||||
#endif
|
||||
|
||||
@@ -182,9 +182,9 @@
|
||||
|
||||
|
||||
// WLEDMM: Do we have the flicker-free RMTHI driver?
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#if !defined(WLED_USE_SHARED_RMT) && !defined(__riscv) && (ESP_IDF_VERSION_MAJOR >= 4)
|
||||
#define WLEDMM_NO_FILEWAIT 1
|
||||
#if !defined(ARDUINO_ARCH_ESP32) || (defined(WLED_USE_SHARED_RMT) || defined(__riscv) || (ESP_IDF_VERSION_MAJOR < 4))
|
||||
#ifndef WLEDMM_FILEWAIT
|
||||
#define WLEDMM_FILEWAIT 1 // wait for LEDs output completion before file reading/writing
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user