Skip to content

Commit

Permalink
Add missing lock/unlock to window cover (#15752)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs authored and pull[bot] committed Sep 13, 2023
1 parent 632cabc commit da8fe89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/window-app/common/src/WindowApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ void WindowApp::DispatchEventAttributeChange(chip::EndpointId endpoint, chip::At
break;
/* RO OperationalStatus */
case Attributes::OperationalStatus::Id:
chip::DeviceLayer::PlatformMgr().LockChipStack();
emberAfWindowCoveringClusterPrint("Global OpState: %02X\n", (unsigned int) OperationalStatusGet(endpoint).global);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
break;
/* RW Mode */
case Attributes::Mode::Id:
Expand Down Expand Up @@ -675,7 +677,11 @@ void WindowApp::Cover::TiltUpdate(bool newTarget)
else /* CURRENT reached TARGET or crossed it */
{
/* Actuator finalize the movement AND CURRENT Must be equal to TARGET at the end */

chip::DeviceLayer::PlatformMgr().LockChipStack();
Attributes::CurrentPositionTiltPercent100ths::Set(mEndpoint, target);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

mTiltOpState = OperationalState::Stall;
}
opStatus.tilt = mTiltOpState;
Expand Down

0 comments on commit da8fe89

Please sign in to comment.