diff --git a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp index 8bc61eeba64e72..c94e6e44fe71b6 100644 --- a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp +++ b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp @@ -52,10 +52,6 @@ ButtonManager ButtonManager::sInstance; TimerHandle_t resetTimer; -#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS) -static bool sitModeRequested; -#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS - CHIP_ERROR ButtonManager::Init() { resetTimer = xTimerCreate("FnTmr", 1, false, (void *) this, [](TimerHandle_t xTimer) { @@ -65,10 +61,6 @@ CHIP_ERROR ButtonManager::Init() }); VerifyOrReturnError(resetTimer != NULL, APP_ERROR_CREATE_TIMER_FAILED); -#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS) - static bool sitModeRequested; -#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS - return CHIP_NO_ERROR; } @@ -208,6 +200,9 @@ void ButtonManager::BleHandler(const AppEvent & event) #if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS) void ButtonManager::DSLSActionEventHandler(const AppEvent & event) { + + static bool sitModeRequested = false; + if (chip::DeviceLayer::ConfigurationMgr().IsFullyProvisioned()) { if (!sitModeRequested) diff --git a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h index 7f4f6cf81d94d3..1f41600b732432 100644 --- a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h +++ b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h @@ -19,6 +19,7 @@ #pragma once #include "AppEvent.h" +#include "AppTask.h" #include "FreeRTOS.h" #include "timers.h" @@ -87,12 +88,14 @@ class ButtonManager */ static void ResetActionEventHandler(const AppEvent & event); +#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS) /** * @brief This callback schedules a DSLS LIT action (Dynamic SIT LIT Support). * * It is used when the app requests SIT mode (check spec, "Runtime Operating Mode Switching") */ static void DSLSActionEventHandler(const AppEvent & event); +#endif /* CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS */ /** * @brief This callback performs a factory reset.