From 1c2e6aac6e9660f0dc101eac64739cedc206f7b1 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Tue, 23 Dec 2025 00:11:40 +0100 Subject: [PATCH] oppsie --- wled00/wled.cpp | 2 ++ wled00/wled.h | 1 + 2 files changed, 3 insertions(+) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 588b8737..02287064 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -479,8 +479,10 @@ void WLED::setup() #ifdef ARDUINO_ARCH_ESP32 busDrawMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent running of strip.show and strip.service segmentMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent segment changes while effects are running + jsonBufferLockMutex = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent JSON buffer writing xSemaphoreGiveRecursive(busDrawMux); // init semaphores to initially allow drawing xSemaphoreGiveRecursive(segmentMux); + xSemaphoreGiveRecursive(jsonBufferLockMutex); #endif #ifdef ARDUINO_ARCH_ESP32 diff --git a/wled00/wled.h b/wled00/wled.h index e947514d..f3abbb7d 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -770,6 +770,7 @@ WLED_GLOBAL volatile bool OTAisRunning _INIT(false); // WLEDMM temporaril #ifdef ARDUINO_ARCH_ESP32 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 esp32SemGive(mux) xSemaphoreGiveRecursive(mux) // convenience macro that expands to xSemaphoreGiveRecursive #define WLED_create_spinlock(theSname) static portMUX_TYPE theSname = portMUX_INITIALIZER_UNLOCKED