diff options
Diffstat (limited to 'ports/esp32/main.c')
-rw-r--r-- | ports/esp32/main.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ports/esp32/main.c b/ports/esp32/main.c index 1420dd579c..4a9c0060b2 100644 --- a/ports/esp32/main.c +++ b/ports/esp32/main.c @@ -66,7 +66,6 @@ // MicroPython runs as a task under FreeRTOS #define MP_TASK_PRIORITY (ESP_TASK_PRIO_MIN + 1) -#define MP_TASK_STACK_SIZE (16 * 1024) // Set the margin for detecting stack overflow, depending on the CPU architecture. #if CONFIG_IDF_TARGET_ESP32C3 @@ -87,7 +86,7 @@ int vprintf_null(const char *format, va_list ap) { void mp_task(void *pvParameter) { volatile uint32_t sp = (uint32_t)esp_cpu_get_sp(); #if MICROPY_PY_THREAD - mp_thread_init(pxTaskGetStackStart(NULL), MP_TASK_STACK_SIZE / sizeof(uintptr_t)); + mp_thread_init(pxTaskGetStackStart(NULL), MICROPY_TASK_STACK_SIZE / sizeof(uintptr_t)); #endif #if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG usb_serial_jtag_init(); @@ -109,7 +108,7 @@ void mp_task(void *pvParameter) { soft_reset: // initialise the stack pointer for the main thread mp_stack_set_top((void *)sp); - mp_stack_set_limit(MP_TASK_STACK_SIZE - MP_TASK_STACK_LIMIT_MARGIN); + mp_stack_set_limit(MICROPY_TASK_STACK_SIZE - MP_TASK_STACK_LIMIT_MARGIN); gc_init(mp_task_heap, mp_task_heap + MP_TASK_HEAP_SIZE); mp_init(); mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib)); @@ -206,7 +205,7 @@ void app_main(void) { MICROPY_BOARD_STARTUP(); // Create and transfer control to the MicroPython task. - xTaskCreatePinnedToCore(mp_task, "mp_task", MP_TASK_STACK_SIZE / sizeof(StackType_t), NULL, MP_TASK_PRIORITY, &mp_main_task_handle, MP_TASK_COREID); + xTaskCreatePinnedToCore(mp_task, "mp_task", MICROPY_TASK_STACK_SIZE / sizeof(StackType_t), NULL, MP_TASK_PRIORITY, &mp_main_task_handle, MP_TASK_COREID); } void nlr_jump_fail(void *val) { |