diff options
-rw-r--r-- | cc3200/simplelink/oslib/osi_freertos.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cc3200/simplelink/oslib/osi_freertos.c b/cc3200/simplelink/oslib/osi_freertos.c index 0475359d09..90acc2e979 100644 --- a/cc3200/simplelink/oslib/osi_freertos.c +++ b/cc3200/simplelink/oslib/osi_freertos.c @@ -61,6 +61,10 @@ TaskHandle_t xSimpleLinkSpawnTaskHndl = NULL; #define slQUEUE_SIZE ( 3 ) #define SL_SPAWN_MAX_WAIT_MS ( 200 ) +// This is the static memory (TCB and stack) for the SL spawn task +static StaticTask_t spawnTaskTCB; +static portSTACK_TYPE spawnTaskStack[896 / sizeof(portSTACK_TYPE)] __attribute__((aligned (8))); + /*! \brief This function registers an interrupt in NVIC table @@ -453,8 +457,19 @@ OsiReturnVal_e VStartSimpleLinkSpawnTask(unsigned portBASE_TYPE uxPriority) xSimpleLinkSpawnQueue = xQueueCreate( slQUEUE_SIZE, sizeof( tSimpleLinkSpawnMsg ) ); ASSERT (xSimpleLinkSpawnQueue != NULL); + /* + // This is the original code to create a task dynamically ASSERT (pdPASS == xTaskCreate( vSimpleLinkSpawnTask, ( portCHAR * ) "SLSPAWN",\ 896 / sizeof(portSTACK_TYPE), NULL, uxPriority, &xSimpleLinkSpawnTaskHndl )); + */ + + // This code creates the task using static memory for the TCB and stack + xSimpleLinkSpawnTaskHndl = xTaskCreateStatic( + vSimpleLinkSpawnTask, ( portCHAR * ) "SLSPAWN", + 896 / sizeof(portSTACK_TYPE), NULL, uxPriority, + spawnTaskStack, &spawnTaskTCB); + + ASSERT(xSimpleLinkSpawnTaskHndl != NULL); return OSI_OK; } |