From da8fe8967307a2c2d8b1704f8c8fffd9f197cd8b Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 2 Mar 2022 20:01:59 -0500 Subject: [PATCH] Add missing lock/unlock to window cover (#15752) --- examples/window-app/common/src/WindowApp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp index 921d171e960cb0..70b5a537b70971 100644 --- a/examples/window-app/common/src/WindowApp.cpp +++ b/examples/window-app/common/src/WindowApp.cpp @@ -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: @@ -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;