Skip to content

Commit e098eac

Browse files
committed
cc3200: Start the simplelink spawn task using the static task creator.
In VStartSimpleLinkSpawnTask we change xTaskCreate to xTaskCreateStatic so that the task is created using statically allocated memory for the TCB and stack. This means that xTaskCreate function is no longer needed (the static version is now used exclusively).
1 parent 5b8e884 commit e098eac

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

cc3200/simplelink/oslib/osi_freertos.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ TaskHandle_t xSimpleLinkSpawnTaskHndl = NULL;
6161
#define slQUEUE_SIZE ( 3 )
6262
#define SL_SPAWN_MAX_WAIT_MS ( 200 )
6363

64+
// This is the static memory (TCB and stack) for the SL spawn task
65+
static StaticTask_t spawnTaskTCB;
66+
static portSTACK_TYPE spawnTaskStack[896 / sizeof(portSTACK_TYPE)] __attribute__((aligned (8)));
67+
6468
/*!
6569
\brief This function registers an interrupt in NVIC table
6670
@@ -453,8 +457,19 @@ OsiReturnVal_e VStartSimpleLinkSpawnTask(unsigned portBASE_TYPE uxPriority)
453457
xSimpleLinkSpawnQueue = xQueueCreate( slQUEUE_SIZE, sizeof( tSimpleLinkSpawnMsg ) );
454458
ASSERT (xSimpleLinkSpawnQueue != NULL);
455459

460+
/*
461+
// This is the original code to create a task dynamically
456462
ASSERT (pdPASS == xTaskCreate( vSimpleLinkSpawnTask, ( portCHAR * ) "SLSPAWN",\
457463
896 / sizeof(portSTACK_TYPE), NULL, uxPriority, &xSimpleLinkSpawnTaskHndl ));
464+
*/
465+
466+
// This code creates the task using static memory for the TCB and stack
467+
xSimpleLinkSpawnTaskHndl = xTaskCreateStatic(
468+
vSimpleLinkSpawnTask, ( portCHAR * ) "SLSPAWN",
469+
896 / sizeof(portSTACK_TYPE), NULL, uxPriority,
470+
spawnTaskStack, &spawnTaskTCB);
471+
472+
ASSERT(xSimpleLinkSpawnTaskHndl != NULL);
458473

459474
return OSI_OK;
460475
}

0 commit comments

Comments
 (0)