improved mutex error handling
- debug message in case of "unexpected" mutex errors - removed experimental delay() in requestJSONBufferLock
This commit is contained in:
@@ -480,6 +480,8 @@ void WLED::setup()
|
||||
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
|
||||
if ((busDrawMux == nullptr) || (segmentMux == nullptr) || (jsonBufferLockMutex == nullptr))
|
||||
USER_PRINTLN(F("setup error: xSemaphoreCreateRecursiveMutex failed.")); // should never happen.
|
||||
xSemaphoreGiveRecursive(busDrawMux); // init semaphores to initially allow drawing
|
||||
xSemaphoreGiveRecursive(segmentMux);
|
||||
xSemaphoreGiveRecursive(jsonBufferLockMutex);
|
||||
|
||||
Reference in New Issue
Block a user