Skip to content

Commit 6078be0

Browse files
committed
Fix efficient clear layer state_sync flow.
1 parent c85d09a commit 6078be0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

device/src/state_sync.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,14 @@ static void prepareData(device_id_t dst, const uint8_t *propDataPtr, state_sync_
696696

697697
STATE_SYNC_LOG("<<< Preparing %s data for %s\n", prop->name, Utils_DeviceIdToString(dst));
698698

699+
uint8_t oldState = DirtyState_Clean;
699700
prop->dirtyState = DirtyState_Clean;
700701

701702
switch (propId) {
702703
case StateSyncPropertyId_LayerActionFirst ... StateSyncPropertyId_LayerActionLast: {
703704
uint8_t layerId = propId - StateSyncPropertyId_LayerActionFirst + LayerId_First;
704705

705-
if (prop->dirtyState == DirtyState_NeedsClearing) {
706+
if (oldState == DirtyState_NeedsClearing) {
706707
submitPreparedData(dst, StateSyncPropertyId_LayerActionsClear, &layerId, sizeof(layerId));
707708
return;
708709
} else {

0 commit comments

Comments
 (0)