diff options
Diffstat (limited to 'cc3200/mptask.c')
| -rw-r--r-- | cc3200/mptask.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c index 80d76f90e..eb673b08c 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -28,6 +28,7 @@ #include <stdint.h> #include "py/mpconfig.h" +#include "py/stackctrl.h" #include "py/obj.h" #include "py/runtime.h" #include "py/gc.h" @@ -104,9 +105,8 @@ static const char fresh_boot_py[] = "# boot.py -- run on boot-up\r\n" ******************************************************************************/ void TASK_Micropython (void *pvParameters) { - // initialize the garbage collector with the top of our stack + // get the top of the stack to initialize the garbage collector uint32_t sp = gc_helper_get_sp(); - gc_collect_init (sp); bool safeboot = false; mptask_pre_init(); @@ -122,6 +122,9 @@ soft_reset: mp_thread_init(); #endif + // initialise the stack pointer for the main thread (must be done after mp_thread_init) + mp_stack_set_top((void*)sp); + // GC init gc_init(&_boot, &_eheap); |
