Skip to content

Commit 1c2e6aa

Browse files
committed
oppsie
1 parent d3076c4 commit 1c2e6aa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

wled00/wled.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,10 @@ void WLED::setup()
479479
#ifdef ARDUINO_ARCH_ESP32
480480
busDrawMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent running of strip.show and strip.service
481481
segmentMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent segment changes while effects are running
482+
jsonBufferLockMutex = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent JSON buffer writing
482483
xSemaphoreGiveRecursive(busDrawMux); // init semaphores to initially allow drawing
483484
xSemaphoreGiveRecursive(segmentMux);
485+
xSemaphoreGiveRecursive(jsonBufferLockMutex);
484486
#endif
485487

486488
#ifdef ARDUINO_ARCH_ESP32

wled00/wled.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ WLED_GLOBAL volatile bool OTAisRunning _INIT(false); // WLEDMM temporaril
770770
#ifdef ARDUINO_ARCH_ESP32
771771
WLED_GLOBAL SemaphoreHandle_t busDrawMux _INIT(nullptr);
772772
WLED_GLOBAL SemaphoreHandle_t segmentMux _INIT(nullptr);
773+
WLED_GLOBAL SemaphoreHandle_t jsonBufferLockMutex _INIT(nullptr);
773774
#define esp32SemTake(mux,timeout) xSemaphoreTakeRecursive(mux, timeout) // convenience macro that expands to xSemaphoreTakeRecursive
774775
#define esp32SemGive(mux) xSemaphoreGiveRecursive(mux) // convenience macro that expands to xSemaphoreGiveRecursive
775776
#define WLED_create_spinlock(theSname) static portMUX_TYPE theSname = portMUX_INITIALIZER_UNLOCKED

0 commit comments

Comments
 (0)