We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3934438 commit 4345b32Copy full SHA for 4345b32
wled00/FX_fcn.cpp
@@ -2405,6 +2405,8 @@ void WS2812FX::resetSegments(bool boundsOnly) { //WLEDMM add boundsonly
2405
_mainSegment = 0;
2406
esp32SemGive(segmentMux);
2407
} else { //WLEDMM boundsonly
2408
+ // WLEDMM protect against parallel access while drawing
2409
+ if (esp32SemTake(segmentMux, 2100) != pdTRUE) return; // wait long, but don't wait forever
2410
for (segment &seg : _segments) {
2411
#ifndef WLED_DISABLE_2D
2412
seg.start = 0;
@@ -2417,6 +2419,7 @@ void WS2812FX::resetSegments(bool boundsOnly) { //WLEDMM add boundsonly
2417
2419
#endif
2418
2420
seg.allocLeds();
2421
}
2422
+ esp32SemGive(segmentMux);
2423
2424
2425
0 commit comments