diff --git a/examples/contact-sensor-app/nxp/common/AppTask.cpp b/examples/contact-sensor-app/nxp/common/AppTask.cpp index 7539bc61e09a1f..2b102adc1b4924 100644 --- a/examples/contact-sensor-app/nxp/common/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/common/AppTask.cpp @@ -18,10 +18,6 @@ #include "AppTask.h" -#if CONFIG_LOW_POWER -#include "PWR_Interface.h" -#endif - #include #include @@ -36,18 +32,6 @@ void ContactSensorApp::AppTask::PreInitMatterStack() ChipLogProgress(DeviceLayer, "Welcome to NXP Contact Sensor Demo App"); } -#if CONFIG_LOW_POWER -void ContactSensorApp::AppTask::AppMatter_DisallowDeviceToSleep() -{ - PWR_DisallowDeviceToSleep(); -} - -void ContactSensorApp::AppTask::AppMatter_AllowDeviceToSleep() -{ - PWR_AllowDeviceToSleep(); -} -#endif - ContactSensorApp::AppTask & ContactSensorApp::AppTask::GetDefaultInstance() { static ContactSensorApp::AppTask sAppTask; diff --git a/examples/contact-sensor-app/nxp/common/include/AppTask.h b/examples/contact-sensor-app/nxp/common/include/AppTask.h index 407572aad254e6..7a4a9a61617970 100644 --- a/examples/contact-sensor-app/nxp/common/include/AppTask.h +++ b/examples/contact-sensor-app/nxp/common/include/AppTask.h @@ -34,10 +34,6 @@ class AppTask : public chip::NXP::App::AppTaskFreeRTOS // AppTaskFreeRTOS virtual methods void PreInitMatterStack() override; -#if CONFIG_LOW_POWER - void AppMatter_DisallowDeviceToSleep() override; - void AppMatter_AllowDeviceToSleep() override; -#endif // This returns an instance of this class. static AppTask & GetDefaultInstance(); diff --git a/examples/platform/nxp/common/app_task/include/AppTaskBase.h b/examples/platform/nxp/common/app_task/include/AppTaskBase.h index ab29af27c29561..2debabf28d305b 100644 --- a/examples/platform/nxp/common/app_task/include/AppTaskBase.h +++ b/examples/platform/nxp/common/app_task/include/AppTaskBase.h @@ -102,7 +102,7 @@ class AppTaskBase * This function can be overridden in order to implement a specific disallow mechanism. * */ - virtual void AppMatter_DisallowDeviceToSleep(void) {} + virtual void AppMatter_DisallowDeviceToSleep(void); /** * \brief Allow entering low power mode. @@ -110,7 +110,7 @@ class AppTaskBase * This function can be overridden in order to implement a specific allow mechanism. * */ - virtual void AppMatter_AllowDeviceToSleep(void) {} + virtual void AppMatter_AllowDeviceToSleep(void); /** * \brief Print onboarding information. diff --git a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp index 2646ffca4ef26d..81907d21634318 100644 --- a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp +++ b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp @@ -75,6 +75,7 @@ #if CONFIG_LOW_POWER #include "LowPower.h" +#include "PWR_Interface.h" #endif #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR @@ -431,6 +432,20 @@ void chip::NXP::App::AppTaskBase::FactoryResetHandler(void) chip::Server::GetInstance().ScheduleFactoryReset(); } +void chip::NXP::App::AppTaskBase::AppMatter_DisallowDeviceToSleep(void) +{ +#if CONFIG_LOW_POWER + PWR_DisallowDeviceToSleep(); +#endif +} + +void chip::NXP::App::AppTaskBase::AppMatter_AllowDeviceToSleep(void) +{ +#if CONFIG_LOW_POWER + PWR_AllowDeviceToSleep(); +#endif +} + void chip::NXP::App::AppTaskBase::PrintOnboardingInfo() { #if CONFIG_NETWORK_LAYER_BLE diff --git a/src/platform/nxp/common/ble/BLEManagerCommon.cpp b/src/platform/nxp/common/ble/BLEManagerCommon.cpp index e970dab55cc232..baba33ecdab48c 100644 --- a/src/platform/nxp/common/ble/BLEManagerCommon.cpp +++ b/src/platform/nxp/common/ble/BLEManagerCommon.cpp @@ -1190,7 +1190,7 @@ void BLEManagerCommon::blekw_gap_connection_cb(deviceId_t deviceId, gapConnectio if (pConnectionEvent->eventType == gConnEvtConnected_c) { -#if CHIP_DEVICE_K32W1 +#if NXP_DEVICE_K32W1_MCXW7X #if defined(nxp_use_low_power) && (nxp_use_low_power == 1) /* Disallow must be called here for K32W1, otherwise an assert will be reached. * Disclaimer: this is a workaround until a better cross platform solution is found. */