Skip to content

Commit 9b5ae9f

Browse files
committed
bugfix: suspendStripService held too long across stateUpdated() call
see discussion in #293 (comment)
1 parent 4345b32 commit 9b5ae9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wled00/json.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,12 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
645645

646646
doAdvancePlaylist = root[F("np")] | doAdvancePlaylist; //advances to next preset in playlist when true
647647

648+
// WLEDMM: Release suspendStripService before stateUpdated() to avoid timeout
649+
if (iAmGroot) suspendStripService = false;
650+
648651
stateUpdated(callMode);
649652
if (presetToRestore) currentPreset = presetToRestore;
650653

651-
if (iAmGroot) suspendStripService = false; // WLEDMM release lock
652654
return stateResponse;
653655
}
654656

@@ -727,9 +729,11 @@ void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset, b
727729
void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segmentBounds, bool selectedSegmentsOnly)
728730
{
729731
//WLEDMM add DEBUG_PRINT (not USER_PRINT)
732+
#ifdef WLED_DEBUG
730733
String temp;
731734
serializeJson(root, temp);
732735
DEBUG_PRINTF("serializeState %d %s\n", forPreset, temp.c_str());
736+
#endif
733737

734738
if (includeBri) {
735739
root["on"] = (bri > 0);

0 commit comments

Comments
 (0)