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
|
if (!f) {doCloseFile = false; return;} // WLEDMM only do all this hick-hack when f is an open file
|
||||||
|
|
||||||
bool oldLock = suspendStripService;
|
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();
|
unsigned long t_wait = millis();
|
||||||
if (strip.isUpdating()) suspendStripService = true; // WLEDMM schedule short pause to prevent LEDs glitching during flash write
|
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
|
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
|
#endif
|
||||||
|
|
||||||
// wait for strip to finish updating, accessing FS during sendout causes glitches
|
// 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();
|
unsigned wait_start = millis();
|
||||||
while (strip.isUpdating() && (millis() - wait_start < 40)) delay(1); // wait max 40ms
|
while (strip.isUpdating() && (millis() - wait_start < 40)) delay(1); // wait max 40ms
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -182,9 +182,9 @@
|
|||||||
|
|
||||||
|
|
||||||
// WLEDMM: Do we have the flicker-free RMTHI driver?
|
// WLEDMM: Do we have the flicker-free RMTHI driver?
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if !defined(ARDUINO_ARCH_ESP32) || (defined(WLED_USE_SHARED_RMT) || defined(__riscv) || (ESP_IDF_VERSION_MAJOR < 4))
|
||||||
#if !defined(WLED_USE_SHARED_RMT) && !defined(__riscv) && (ESP_IDF_VERSION_MAJOR >= 4)
|
#ifndef WLEDMM_FILEWAIT
|
||||||
#define WLEDMM_NO_FILEWAIT 1
|
#define WLEDMM_FILEWAIT 1 // wait for LEDs output completion before file reading/writing
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user