Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 20 additions & 32 deletions examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ void AppTask::OTAHandler(AppEvent * aEvent)
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void AppTask::StartOTAQuery(intptr_t arg)
{
static_cast<OTARequestor *>(GetRequestorInstance())->TriggerImmediateQuery();
static_cast<OTARequestor *>(GetRequestorInstance())->TriggerImmediateQuery();
}
#endif

Expand Down Expand Up @@ -543,19 +543,19 @@ void AppTask::BleHandler(AppEvent * aEvent)
}

#if CONFIG_CHIP_NFC_COMMISSIONING
void AppTask::ThreadProvisioningHandler(const ChipDeviceEvent * event, intptr_t)
{
if (event->Type == DeviceEventType::kServiceProvisioningChange && event->ServiceProvisioningChange.IsServiceProvisioned)
{
if (event->ServiceProvisioningChange.IsServiceProvisioned)
{
sIsThreadProvisioned = TRUE;
}
else
{
sIsThreadProvisioned = FALSE;
}
}
void AppTask::ThreadProvisioningHandler(const ChipDeviceEvent * event, intptr_t)
{
if (event->Type == DeviceEventType::kServiceProvisioningChange && event->ServiceProvisioningChange.IsServiceProvisioned)
{
if (event->ServiceProvisioningChange.IsServiceProvisioned)
{
sIsThreadProvisioned = TRUE;
}
else
{
sIsThreadProvisioned = FALSE;
}
}

if (event->Type == DeviceEventType::kCHIPoBLEAdvertisingChange && event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped)
{
Expand Down Expand Up @@ -689,18 +689,6 @@ void AppTask::OTAResumeEventHandler(AppEvent * aEvent)
}
}

extern "C" void vApplicationIdleHook( void )
{
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
OTA_TransactionResume();

if (shouldReset)
{
ResetMCU();
}
#endif
}

void AppTask::PostEvent(const AppEvent * aEvent)
{
if (sAppEventQueue != NULL)
Expand Down Expand Up @@ -744,12 +732,12 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)

void AppTask::UpdateDeviceState(void)
{
bool onoffAttrValue = 0;
bool onoffAttrValue = 0;

/* get onoff attribute value */
(void)emberAfReadAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
(uint8_t *) &onoffAttrValue, 1, NULL);
/* get onoff attribute value */
(void)emberAfReadAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
(uint8_t *) &onoffAttrValue, 1, NULL);

/* set the device state */
sLightLED.Set(onoffAttrValue);
/* set the device state */
sLightLED.Set(onoffAttrValue);
}
23 changes: 20 additions & 3 deletions examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "PWR_Interface.h"
#include "TimersManager.h"
#include "board.h"
#include "PDM.h"

/* Bluetooth Low Energy */
#include "ble_config.h"
Expand All @@ -52,6 +53,10 @@
#define APP_DBG_LOG(...)
#endif

#define PDM_MAX_WRITES_INFINITE 0xFF

extern bool shouldReset;

static inline void mutex_init(mbedtls_threading_mutex_t * p_mutex)
{
assert(p_mutex != NULL);
Expand Down Expand Up @@ -218,6 +223,8 @@ void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
OSA_InterruptEnable();
}

#endif /* (cPWR_UsePowerDownMode) && (configUSE_TICKLESS_IDLE != 0) */

static void BOARD_ActionOnIdle(void)
{
#if ((defined gTcxo32k_ModeEn_c) && (gTcxo32k_ModeEn_c != 0))
Expand All @@ -230,7 +237,17 @@ static void BOARD_ActionOnIdle(void)

void vApplicationIdleHook(void)
{
BOARD_ActionOnIdle();
}
PDM_vIdleTask(PDM_MAX_WRITES_INFINITE);

#endif /* (cPWR_UsePowerDownMode) && (configUSE_TICKLESS_IDLE != 0) */
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
OTA_TransactionResume();

if (shouldReset)
{
ResetMCU();
}
#endif


BOARD_ActionOnIdle();
}
2 changes: 2 additions & 0 deletions src/platform/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ static_library("k32w0") {
"DiagnosticDataProviderImpl.h",
"K32W0Config.cpp",
"K32W0Config.h",
"ram_storage.c",
"ram_storage.h",
"KeyValueStoreManagerImpl.cpp",
"KeyValueStoreManagerImpl.h",
"Logging.cpp",
Expand Down
Loading