avoid updating strip / segments while draving effects (ESP32 only)
💫 this is the way🌟 A new locking mechanism that allows to wait until strip.service() has completed.
This commit is contained in:
@@ -164,8 +164,17 @@ void WLED::loop()
|
||||
#ifdef WLED_DEBUG
|
||||
unsigned long stripMillis = millis();
|
||||
#endif
|
||||
if (!offMode || strip.isOffRefreshRequired())
|
||||
strip.service();
|
||||
if (!offMode || strip.isOffRefreshRequired()) {
|
||||
static unsigned long lastTimeService = 0; // WLEMM needed to remove stale lock
|
||||
if (!suspendStripService && !doInitBusses && !loadLedmap) { // WLEDMM prevent effect drawing while strip or segments are being updated
|
||||
strip.service();
|
||||
lastTimeService = millis();
|
||||
} else {
|
||||
if (suspendStripService && (millis() - lastTimeService > 1500)) { // WLEDMM remove stale lock after 1.5 seconds
|
||||
USER_PRINTLN("--> looptask: stale suspendStripService lock removed after 1500 ms."); // should not happen - check for missing "suspendStripService = false"
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef ESP8266
|
||||
else if (!noWifiSleep)
|
||||
delay(1); //required to make sure ESP enters modem sleep (see #1184)
|
||||
|
||||
Reference in New Issue
Block a user