summaryrefslogtreecommitdiffstatshomepage
path: root/cc3200/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'cc3200/main.c')
-rw-r--r--cc3200/main.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/cc3200/main.c b/cc3200/main.c
index 78b4e3161c..06b3604b67 100644
--- a/cc3200/main.c
+++ b/cc3200/main.c
@@ -36,6 +36,7 @@
#include "debug.h"
#include "antenna.h"
#include "mperror.h"
+#include "task.h"
/******************************************************************************
DECLARE PRIVATE CONSTANTS
@@ -49,6 +50,10 @@
DECLARE PRIVATE DATA
******************************************************************************/
+// This is the static memory (TCB and stack) for the idle task
+static StaticTask_t xIdleTaskTCB __attribute__ ((section (".rtos_heap")));
+static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
+
/******************************************************************************
DECLARE PUBLIC DATA
******************************************************************************/
@@ -56,6 +61,13 @@
OsiTaskHandle mpTaskHandle;
#endif
+// This is the FreeRTOS heap, defined here so we can put it in a special segment
+uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
+
+// This is the static memory (TCB and stack) for the main MicroPython task
+StaticTask_t mpTaskTCB __attribute__ ((section (".rtos_heap")));
+StackType_t mpTaskStack[MICROPY_TASK_STACK_LEN] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
+
/******************************************************************************
DEFINE PUBLIC FUNCTIONS
******************************************************************************/
@@ -74,15 +86,12 @@ int main (void) {
// Init the watchdog
pybwdt_init0();
-#ifdef DEBUG
- ASSERT (OSI_OK == osi_TaskCreate(TASK_Micropython,
- (const signed char *)"MicroPy",
- MICROPY_TASK_STACK_SIZE, NULL, MICROPY_TASK_PRIORITY, &mpTaskHandle));
-#else
- ASSERT (OSI_OK == osi_TaskCreate(TASK_Micropython,
- (const signed char *)"MicroPy",
- MICROPY_TASK_STACK_SIZE, NULL, MICROPY_TASK_PRIORITY, NULL));
+#ifndef DEBUG
+ OsiTaskHandle mpTaskHandle;
#endif
+ mpTaskHandle = xTaskCreateStatic(TASK_Micropython, "MicroPy",
+ MICROPY_TASK_STACK_LEN, NULL, MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB);
+ ASSERT(mpTaskHandle != NULL);
osi_start();
@@ -95,3 +104,12 @@ void stoupper (char *str) {
str++;
}
}
+
+// We need this when configSUPPORT_STATIC_ALLOCATION is enabled
+void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
+ StackType_t **ppxIdleTaskStackBuffer,
+ uint32_t *pulIdleTaskStackSize ) {
+ *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
+ *ppxIdleTaskStackBuffer = uxIdleTaskStack;
+ *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
+}