Move queue to global memory
The FreeRTOS port resets the stack when the scheduler starts. Move the
queue to global memory for it to not be overwritten.
Change-Id: I98f2360a14a0f74a65353694c6e2f60d37461ecf
diff --git a/applications/freertos/main.cpp b/applications/freertos/main.cpp
index b926d1e..539dff5 100644
--- a/applications/freertos/main.cpp
+++ b/applications/freertos/main.cpp
@@ -252,9 +252,12 @@
} // namespace
+/* Keep the queue ouf of the stack sinde freertos resets it when the scheduler starts.*/
+QueueHandle_t inferenceProcessQueue;
+
int main() {
// Inference process
- QueueHandle_t inferenceProcessQueue = xQueueCreate(10, sizeof(xInferenceJob *));
+ inferenceProcessQueue = xQueueCreate(10, sizeof(xInferenceJob *));
xTaskCreate(inferenceProcessTask, "inferenceProcess", 2 * 1024, inferenceProcessQueue, 1, nullptr);
// Inference job task