Skip to content

Commit

Permalink
Move K32W0 PDM writes to the idle task (#18978)
Browse files Browse the repository at this point in the history
* [K32W0] Use PDM SaveOnIdle

Lengthy flash operations are postponed on the idle task.

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

* Fix KVS

Signed-off-by: Doru Gucea <[email protected]>

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jun 22, 2023
1 parent c6346a0 commit 5229375
Show file tree
Hide file tree
Showing 10 changed files with 574 additions and 400 deletions.
2 changes: 0 additions & 2 deletions examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ static OTAImageProcessorImpl gImageProcessor;
constexpr uint16_t requestedOtaBlockSize = 1024;
#endif

extern bool shouldReset;

CHIP_ERROR AppTask::StartAppTask()
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
6 changes: 5 additions & 1 deletion examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>

#include "PDM.h"
#include "PWR_Interface.h"
#include "TimersManager.h"
#include "board.h"
Expand All @@ -52,6 +53,8 @@
#define APP_DBG_LOG(...)
#endif

#define PDM_MAX_WRITES_INFINITE 0xFF

static inline void mutex_init(mbedtls_threading_mutex_t * p_mutex)
{
assert(p_mutex != NULL);
Expand Down Expand Up @@ -229,10 +232,11 @@ static void BOARD_ActionOnIdle(void)
#endif
}

extern void OTAIdleActivities();
extern void OTAIdleActivities(void);

void vApplicationIdleHook(void)
{
PDM_vIdleTask(PDM_MAX_WRITES_INFINITE);
OTAIdleActivities();
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 @@ -47,6 +47,8 @@ static_library("k32w0") {
"NFCManagerImpl.h",
"PlatformManagerImpl.cpp",
"PlatformManagerImpl.h",
"RamStorage.cpp",
"RamStorage.h",
"ble_function_mux.c",
]

Expand Down
Loading

0 comments on commit 5229375

Please sign in to comment.