diff options
Diffstat (limited to 'applications/message_handler/main.cpp')
-rw-r--r-- | applications/message_handler/main.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/applications/message_handler/main.cpp b/applications/message_handler/main.cpp index 73eb398..0b4860a 100644 --- a/applications/message_handler/main.cpp +++ b/applications/message_handler/main.cpp @@ -173,6 +173,7 @@ int ethosu_semaphore_give(void *sem) { /**************************************************************************** * Application ****************************************************************************/ +namespace { struct TaskParams { TaskParams() : @@ -192,8 +193,6 @@ struct InferenceTaskParams { uint8_t *arena; }; -namespace { - #ifdef MHU_IRQ void mailboxIrqHandler() { mailbox.handleMessage(); @@ -233,6 +232,13 @@ void messageTask(void *pvParameters) { process.run(); } +/* + * Keep task parameters as global data as FreeRTOS resets the stack when the + * scheduler is started. + */ +TaskParams taskParams; +InferenceTaskParams infParams[NUM_PARALLEL_TASKS]; + } // namespace // FreeRTOS application. NOTE: Additional tasks may require increased heap size. @@ -244,8 +250,6 @@ int main() { return 1; } - TaskParams taskParams; - // Task for handling incoming /outgoing messages from the remote host ret = xTaskCreate(messageTask, "messageTask", 1024, &taskParams, 2, nullptr); if (ret != pdPASS) { @@ -253,8 +257,6 @@ int main() { return ret; } - InferenceTaskParams infParams[NUM_PARALLEL_TASKS]; - // One inference task for each NPU for (size_t n = 0; n < NUM_PARALLEL_TASKS; n++) { infParams[n].taskParams = &taskParams; |