summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-06-05 12:57:18 +0100
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:53 +0100
commite098eac19552a5a399ffbfae44e4b329ca623d0d (patch)
tree08b6acb808020ba95f3b532d941c0dc684b56d41
parent5b8e884573d582d2c48c7b344a8876fbbeb67692 (diff)
downloadmicropython-e098eac19552a5a399ffbfae44e4b329ca623d0d.tar.gz
micropython-e098eac19552a5a399ffbfae44e4b329ca623d0d.zip
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).
-rw-r--r--cc3200/simplelink/oslib/osi_freertos.c15
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;
}