From 23840004330728fb20249c6ef0b15dae2d5dca06 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Mon, 15 May 2023 22:53:27 -0400 Subject: [PATCH] Complete Button Abstraction (#26581) --- examples/chef/efr32/src/AppTask.cpp | 4 ---- .../silabs/SiWx917/src/AppTask.cpp | 7 ++++--- .../silabs/efr32/src/AppTask.cpp | 9 +++------ .../silabs/SiWx917/src/AppTask.cpp | 5 +++-- .../silabs/efr32/include/AppTask.h | 4 ++-- .../lighting-app/silabs/efr32/src/AppTask.cpp | 19 +++++-------------- .../lock-app/silabs/SiWx917/src/AppTask.cpp | 5 +++-- .../lock-app/silabs/efr32/src/AppTask.cpp | 7 ++----- .../silabs/SiWx917/BaseApplication.cpp | 5 ++++- .../platform/silabs/efr32/BaseApplication.cpp | 16 +++++++--------- .../platform/silabs/efr32/BaseApplication.h | 7 ++----- .../thermostat/silabs/efr32/src/AppTask.cpp | 4 ---- .../silabs/efr32/src/WindowAppImpl.cpp | 9 +++------ .../platformAbstraction/SilabsPlatform.h | 8 ++++++++ 14 files changed, 46 insertions(+), 63 deletions(-) mode change 100755 => 100644 examples/lighting-app/silabs/efr32/src/AppTask.cpp diff --git a/examples/chef/efr32/src/AppTask.cpp b/examples/chef/efr32/src/AppTask.cpp index ee2e2921202fc6..d166243033cdd6 100644 --- a/examples/chef/efr32/src/AppTask.cpp +++ b/examples/chef/efr32/src/AppTask.cpp @@ -125,9 +125,7 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); -#endif err = BaseApplication::Init(&gIdentify); if (err != CHIP_NO_ERROR) @@ -169,7 +167,6 @@ void AppTask::AppTaskMain(void * pvParameter) } } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) { AppEvent button_event = {}; @@ -182,4 +179,3 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) sAppTask.PostEvent(&button_event); } } -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp b/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp index 3cf6d9a034cae7..d76dc9de2526e4 100644 --- a/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp +++ b/examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp @@ -69,6 +69,7 @@ constexpr chip::EndpointId kGenericSwitchEndpoint = 2; using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -239,7 +240,7 @@ void AppTask::SwitchActionEventHandler(AppEvent * aEvent) static bool mCurrentButtonState = false; - if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) + if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { mCurrentButtonState = !mCurrentButtonState; LightSwitchMgr::LightSwitchAction action = @@ -252,7 +253,7 @@ void AppTask::SwitchActionEventHandler(AppEvent * aEvent) sAppTask.GetLCD().WriteDemoUI(mCurrentButtonState); #endif } - else if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_RELEASED) + else if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonReleased)) { LightSwitchMgr::GetInstance().GenericSwitchOnShortRelease(); } @@ -268,7 +269,7 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) button_event.Handler = SwitchActionEventHandler; sAppTask.PostEvent(&button_event); } - else if (button == SIWx917_BTN0 && btnAction == SL_SIMPLE_BUTTON_PRESSED) + else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = BaseApplication::ButtonHandler; sAppTask.PostEvent(&button_event); diff --git a/examples/light-switch-app/silabs/efr32/src/AppTask.cpp b/examples/light-switch-app/silabs/efr32/src/AppTask.cpp index 81ba6afad54c0a..38dea28cc6abd8 100644 --- a/examples/light-switch-app/silabs/efr32/src/AppTask.cpp +++ b/examples/light-switch-app/silabs/efr32/src/AppTask.cpp @@ -68,6 +68,7 @@ constexpr chip::EndpointId kGenericSwitchEndpoint = 2; using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -153,9 +154,7 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); -#endif #ifdef DISPLAY_ENABLED GetLCD().Init((uint8_t *) "Light Switch"); @@ -229,14 +228,13 @@ void AppTask::OnIdentifyStop(Identify * identify) #endif } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT void AppTask::SwitchActionEventHandler(AppEvent * aEvent) { VerifyOrReturn(aEvent->Type == AppEvent::kEventType_Button); static bool mCurrentButtonState = false; - if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) + if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { mCurrentButtonState = !mCurrentButtonState; LightSwitchMgr::LightSwitchAction action = @@ -249,7 +247,7 @@ void AppTask::SwitchActionEventHandler(AppEvent * aEvent) sAppTask.GetLCD().WriteDemoUI(mCurrentButtonState); #endif } - else if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_RELEASED) + else if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonReleased)) { LightSwitchMgr::GetInstance().GenericSwitchOnShortRelease(); } @@ -272,4 +270,3 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) sAppTask.PostEvent(&button_event); } } -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp index 15474dc8527065..d57caba69674f0 100644 --- a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp +++ b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp @@ -43,6 +43,7 @@ using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -240,12 +241,12 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) AppEvent button_event = {}; button_event.Type = AppEvent::kEventType_Button; button_event.ButtonEvent.Action = btnAction; - if (button == SIWx917_BTN1 && btnAction == SL_SIMPLE_BUTTON_PRESSED) + if (button == SIWx917_BTN1 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = LightActionEventHandler; sAppTask.PostEvent(&button_event); } - else if (button == SIWx917_BTN0 && btnAction == SL_SIMPLE_BUTTON_PRESSED) + else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = BaseApplication::ButtonHandler; sAppTask.PostEvent(&button_event); diff --git a/examples/lighting-app/silabs/efr32/include/AppTask.h b/examples/lighting-app/silabs/efr32/include/AppTask.h index f8ad1b45367a0b..9c988e9b3d8807 100644 --- a/examples/lighting-app/silabs/efr32/include/AppTask.h +++ b/examples/lighting-app/silabs/efr32/include/AppTask.h @@ -68,7 +68,7 @@ class AppTask : public BaseApplication static void AppTaskMain(void * pvParameter); CHIP_ERROR StartAppTask(); -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + /** * @brief Event handler when a button is pressed * Function posts an event for button processing @@ -78,7 +78,7 @@ class AppTask : public BaseApplication * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED */ static void ButtonEventHandler(uint8_t button, uint8_t btnAction); -#endif + /** * @brief Callback called by the identify-server when an identify command is received * diff --git a/examples/lighting-app/silabs/efr32/src/AppTask.cpp b/examples/lighting-app/silabs/efr32/src/AppTask.cpp old mode 100755 new mode 100644 index a8c63c8e61b1d0..f40e13a7c01135 --- a/examples/lighting-app/silabs/efr32/src/AppTask.cpp +++ b/examples/lighting-app/silabs/efr32/src/AppTask.cpp @@ -46,14 +46,12 @@ #define LIGHT_LED 0 #endif -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT - #define APP_FUNCTION_BUTTON 0 #define APP_LIGHT_SWITCH 1 -#endif using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -132,9 +130,7 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); -#endif #ifdef DISPLAY_ENABLED GetLCD().Init((uint8_t *) "Lighting-App"); @@ -241,13 +237,11 @@ void AppTask::LightActionEventHandler(AppEvent * aEvent) action = static_cast(aEvent->LightEvent.Action); actor = aEvent->LightEvent.Actor; } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT else if (aEvent->Type == AppEvent::kEventType_Button) { action = (LightMgr().IsLightOn()) ? LightingManager::OFF_ACTION : LightingManager::ON_ACTION; actor = AppEvent::kEventType_Button; } -#endif else { err = APP_ERROR_UNHANDLED_EVENT; @@ -263,14 +257,14 @@ void AppTask::LightActionEventHandler(AppEvent * aEvent) } } } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) { AppEvent button_event = {}; button_event.Type = AppEvent::kEventType_Button; button_event.ButtonEvent.Action = btnAction; - if (button == APP_LIGHT_SWITCH && btnAction == SL_SIMPLE_BUTTON_PRESSED) + if (button == APP_LIGHT_SWITCH && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = LightActionEventHandler; AppTask::GetAppTask().PostEvent(&button_event); @@ -281,7 +275,6 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) AppTask::GetAppTask().PostEvent(&button_event); } } -#endif void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) { @@ -294,12 +287,11 @@ void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) #ifdef DISPLAY_ENABLED sAppTask.GetLCD().WriteDemoUI(lightOn); #endif -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + if (aActor == AppEvent::kEventType_Button) { sAppTask.mSyncClusterToButtonAction = true; } -#endif } void AppTask::ActionCompleted(LightingManager::Action_t aAction) @@ -313,13 +305,12 @@ void AppTask::ActionCompleted(LightingManager::Action_t aAction) { SILABS_LOG("Light OFF") } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + if (sAppTask.mSyncClusterToButtonAction) { chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast(nullptr)); sAppTask.mSyncClusterToButtonAction = false; } -#endif } void AppTask::PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction) diff --git a/examples/lock-app/silabs/SiWx917/src/AppTask.cpp b/examples/lock-app/silabs/SiWx917/src/AppTask.cpp index fe1d267e465f02..006d81ef66d0b0 100644 --- a/examples/lock-app/silabs/SiWx917/src/AppTask.cpp +++ b/examples/lock-app/silabs/SiWx917/src/AppTask.cpp @@ -61,6 +61,7 @@ using chip::app::Clusters::DoorLock::OperationSourceEnum; using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; using namespace ::chip::DeviceLayer::Internal; using namespace SI917DoorLock::LockInitParams; @@ -348,12 +349,12 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) button_event.Type = AppEvent::kEventType_Button; button_event.ButtonEvent.Action = btnAction; - if (button == SIWx917_BTN1 && btnAction == SL_SIMPLE_BUTTON_PRESSED) + if (button == SIWx917_BTN1 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = LockActionEventHandler; sAppTask.PostEvent(&button_event); } - else if (button == SIWx917_BTN0 && btnAction == SL_SIMPLE_BUTTON_PRESSED) + else if (button == SIWx917_BTN0 && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = BaseApplication::ButtonHandler; sAppTask.PostEvent(&button_event); diff --git a/examples/lock-app/silabs/efr32/src/AppTask.cpp b/examples/lock-app/silabs/efr32/src/AppTask.cpp index 93226e14f28646..cf3d1f5e40cfcc 100644 --- a/examples/lock-app/silabs/efr32/src/AppTask.cpp +++ b/examples/lock-app/silabs/efr32/src/AppTask.cpp @@ -64,6 +64,7 @@ using chip::app::Clusters::DoorLock::OperationSourceEnum; using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; using namespace ::chip::DeviceLayer::Internal; using namespace EFR32DoorLock::LockInitParams; @@ -143,9 +144,7 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT #ifdef DISPLAY_ENABLED GetLCD().Init((uint8_t *) "Lock-App", true); @@ -361,14 +360,13 @@ void AppTask::LockActionEventHandler(AppEvent * aEvent) } } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) { AppEvent button_event = {}; button_event.Type = AppEvent::kEventType_Button; button_event.ButtonEvent.Action = btnAction; - if (button == APP_LOCK_SWITCH && btnAction == SL_SIMPLE_BUTTON_PRESSED) + if (button == APP_LOCK_SWITCH && btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { button_event.Handler = LockActionEventHandler; sAppTask.PostEvent(&button_event); @@ -379,7 +377,6 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) sAppTask.PostEvent(&button_event); } } -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT void AppTask::ActionInitiated(LockManager::Action_t aAction, int32_t aActor) { diff --git a/examples/platform/silabs/SiWx917/BaseApplication.cpp b/examples/platform/silabs/SiWx917/BaseApplication.cpp index 62b5f4cc1bc361..8412eff3e81fc7 100644 --- a/examples/platform/silabs/SiWx917/BaseApplication.cpp +++ b/examples/platform/silabs/SiWx917/BaseApplication.cpp @@ -47,6 +47,8 @@ #include #include +#include + #ifdef SL_WIFI #include "wfx_host_events.h" #include @@ -70,6 +72,7 @@ using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -355,7 +358,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) // FACTORY_RESET_TRIGGER_TIMEOUT to signal factory reset has been initiated. // To cancel factory reset: release the APP_FUNCTION_BUTTON once all LEDs // start blinking within the FACTORY_RESET_CANCEL_WINDOW_TIMEOUT - if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) + if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { if ((!mFunctionTimerActive) && (mFunction == kFunction_NoneSelected)) { diff --git a/examples/platform/silabs/efr32/BaseApplication.cpp b/examples/platform/silabs/efr32/BaseApplication.cpp index 9d096f23353cab..baf16e78cc2510 100644 --- a/examples/platform/silabs/efr32/BaseApplication.cpp +++ b/examples/platform/silabs/efr32/BaseApplication.cpp @@ -53,6 +53,8 @@ #include #endif // CHIP_ENABLE_OPENTHREAD +#include + #ifdef SL_WIFI #include "wfx_host_events.h" #include @@ -75,12 +77,11 @@ #if defined(ENABLE_WSTK_LEDS) && defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) #define SYSTEM_STATE_LED 0 #endif // ENABLE_WSTK_LEDS -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT #define APP_FUNCTION_BUTTON 0 -#endif using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; namespace { @@ -397,7 +398,7 @@ void BaseApplication::LightEventHandler() sStatusLED.Animate(); #endif // ENABLE_WSTK_LEDS } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + void BaseApplication::ButtonHandler(AppEvent * aEvent) { // To trigger software update: press the APP_FUNCTION_BUTTON button briefly (< @@ -407,7 +408,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) // FACTORY_RESET_TRIGGER_TIMEOUT to signal factory reset has been initiated. // To cancel factory reset: release the APP_FUNCTION_BUTTON once all LEDs // start blinking within the FACTORY_RESET_CANCEL_WINDOW_TIMEOUT - if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) + if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { if (!mFunctionTimerActive && mFunction == kFunction_NoneSelected) { @@ -444,10 +445,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) SILABS_LOG("Failed to open the Basic Commissioning Window"); } } - else - { - SILABS_LOG("Network is already provisioned, Ble advertissement not enabled"); - } + else { SILABS_LOG("Network is already provisioned, Ble advertissement not enabled"); } } else if (mFunctionTimerActive && mFunction == kFunction_FactoryReset) { @@ -464,7 +462,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) } } } -#endif + void BaseApplication::CancelFunctionTimer() { if (xTimerStop(sFunctionTimer, pdMS_TO_TICKS(0)) == pdFAIL) diff --git a/examples/platform/silabs/efr32/BaseApplication.h b/examples/platform/silabs/efr32/BaseApplication.h index 191fcba4aaf3f3..d8bd8e9a6a7502 100644 --- a/examples/platform/silabs/efr32/BaseApplication.h +++ b/examples/platform/silabs/efr32/BaseApplication.h @@ -28,9 +28,6 @@ #include "AppEvent.h" #include "FreeRTOS.h" -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT -#include "sl_simple_button_instances.h" -#endif #include "timers.h" // provides FreeRTOS timer support #include #include @@ -153,7 +150,7 @@ class BaseApplication * @param aEvent post event being processed */ static void FunctionEventHandler(AppEvent * aEvent); -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT + /** * @brief PB0 Button event processing function * Press and hold will trigger a factory reset timer start @@ -162,7 +159,7 @@ class BaseApplication * @param aEvent button event being processed */ static void ButtonHandler(AppEvent * aEvent); -#endif + /** * @brief Light Timer finished callback function * Calls LED processing function diff --git a/examples/thermostat/silabs/efr32/src/AppTask.cpp b/examples/thermostat/silabs/efr32/src/AppTask.cpp index ef7204cbfd4b82..2e506d1658223c 100644 --- a/examples/thermostat/silabs/efr32/src/AppTask.cpp +++ b/examples/thermostat/silabs/efr32/src/AppTask.cpp @@ -142,9 +142,7 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT #ifdef DISPLAY_ENABLED GetLCD().Init((uint8_t *) "Thermostat-App"); @@ -246,7 +244,6 @@ void AppTask::UpdateThermoStatUI() #endif // DISPLAY_ENABLED } -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) { AppEvent aEvent = {}; @@ -259,4 +256,3 @@ void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) sAppTask.PostEvent(&aEvent); } } -#endif // SL_CATALOG_SIMPLE_BUTTON_PRESENT diff --git a/examples/window-app/silabs/efr32/src/WindowAppImpl.cpp b/examples/window-app/silabs/efr32/src/WindowAppImpl.cpp index 51c6652c6da149..c4e48212e56e42 100644 --- a/examples/window-app/silabs/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/silabs/efr32/src/WindowAppImpl.cpp @@ -31,9 +31,6 @@ #include #include #endif // QR_CODE_ENABLED -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT -#include -#endif #include @@ -60,6 +57,7 @@ SilabsLCD slLCD; using namespace chip::app::Clusters::WindowCovering; using namespace chip; using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Silabs; #define APP_STATE_LED 0 #define APP_ACTION_LED 1 @@ -518,9 +516,9 @@ WindowAppImpl::Button::Button(WindowApp::Button::Id id, const char * name) : Win void WindowAppImpl::OnButtonChange(uint8_t button, uint8_t btnAction) { -#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT WindowApp::Button * btn = static_cast