summaryrefslogtreecommitdiffstatshomepage
path: root/cc3200/mptask.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-31 17:27:21 +0100
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:52 +0100
commit0455755296b27440e68cad1ca43c342d9a452f88 (patch)
treeaa8451960fc94ac3b3bf07ad636b00d97c3ca15a /cc3200/mptask.c
parent77e37ff98bec1ccf6af6edf3efcad26b54da0c47 (diff)
downloadmicropython-0455755296b27440e68cad1ca43c342d9a452f88.tar.gz
micropython-0455755296b27440e68cad1ca43c342d9a452f88.zip
cc3200: Use xTaskCreateStatic instead of osi_TaskCreate.
This allows to statically allocate the TCB (thread control block) and thread stack in the BSS segment, reducing the need for dynamic memory allocation.
Diffstat (limited to 'cc3200/mptask.c')
-rw-r--r--cc3200/mptask.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index 828263c4a1..80d76f90e9 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -69,6 +69,7 @@
#include "updater.h"
#include "moduos.h"
#include "antenna.h"
+#include "task.h"
/******************************************************************************
DECLARE PRIVATE CONSTANTS
@@ -277,15 +278,12 @@ STATIC void mptask_pre_init (void) {
//CRYPTOHASH_Init();
-#ifdef DEBUG
- ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers,
- (const signed char *)"Servers",
- SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, &svTaskHandle));
-#else
- ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers,
- (const signed char *)"Servers",
- SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, NULL));
+#ifndef DEBUG
+ OsiTaskHandle svTaskHandle;
#endif
+ svTaskHandle = xTaskCreateStatic(TASK_Servers, "Servers",
+ SERVERS_STACK_LEN, NULL, SERVERS_PRIORITY, svTaskStack, &svTaskTCB);
+ ASSERT(svTaskHandle != NULL);
}
STATIC void mptask_init_sflash_filesystem (void) {