clarifications (minor)
* replace delay by vTaskDelay (same behaviour) * degrade user message to debug (expected behaviour -> no message) * add pdMS_TO_TICKS to esp32SemTake macro (future proof)
This commit is contained in:
@@ -540,9 +540,9 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
// WLEDMM: Acquire strip lock right before segment operations (deferred for better UX)
|
||||
suspendStripService = true; // temporarily lock out strip updates
|
||||
delay(2); // WLEDMM experimental - de-serialize takes time, so allow other tasks to run
|
||||
vTaskDelay(pdMS_TO_TICKS(2)); // WLEDMM trigger a short task context switch
|
||||
if (strip.isServicing()) {
|
||||
USER_PRINTLN(F("deserializeState(): strip is still drawing effects."));
|
||||
DEBUG_PRINTLN(F("deserializeState(): strip is still drawing effects."));
|
||||
strip.waitUntilIdle();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -771,7 +771,7 @@ WLED_GLOBAL volatile bool OTAisRunning _INIT(false); // WLEDMM temporaril
|
||||
WLED_GLOBAL SemaphoreHandle_t busDrawMux _INIT(nullptr);
|
||||
WLED_GLOBAL SemaphoreHandle_t segmentMux _INIT(nullptr);
|
||||
WLED_GLOBAL SemaphoreHandle_t jsonBufferLockMutex _INIT(nullptr);
|
||||
#define esp32SemTake(mux,timeout) xSemaphoreTakeRecursive(mux, timeout) // convenience macro that expands to xSemaphoreTakeRecursive
|
||||
#define esp32SemTake(mux,timeout) xSemaphoreTakeRecursive(mux, pdMS_TO_TICKS(timeout)) // convenience macro that expands to xSemaphoreTakeRecursive - timeout is in milliseconds
|
||||
#define esp32SemGive(mux) xSemaphoreGiveRecursive(mux) // convenience macro that expands to xSemaphoreGiveRecursive
|
||||
#define WLED_create_spinlock(theSname) static portMUX_TYPE theSname = portMUX_INITIALIZER_UNLOCKED
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user