diff options
| author | Damien George <damien@micropython.org> | 2025-07-29 23:09:49 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-09-11 12:55:36 +1000 |
| commit | d441788975a6dfb277ad9a3d54d651ae48817d16 (patch) | |
| tree | 14a1bce671140acfb57f8c419e473134400d089d | |
| parent | e453d9d9f14ec5eabd1077d32ed8f293faeefb13 (diff) | |
esp8266/main: Use new cstack API and add a stack margin of 64 bytes.
The margin of 64 bytes is needed to get `micropython/extreme_exc.py` to
pass when run via-mpy.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/esp8266/main.c | 4 | ||||
| -rw-r--r-- | ports/esp8266/mpconfigport.h | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/ports/esp8266/main.c b/ports/esp8266/main.c index da712fce9..fb6cda379 100644 --- a/ports/esp8266/main.c +++ b/ports/esp8266/main.c @@ -31,7 +31,6 @@ #include "py/builtin.h" #include "py/compile.h" #include "py/runtime.h" -#include "py/stackctrl.h" #include "py/mperrno.h" #include "py/mphal.h" #include "py/gc.h" @@ -108,8 +107,7 @@ static void print_reset_info(void) { #endif static void mp_reset(void) { - mp_stack_set_top((void *)0x40000000); - mp_stack_set_limit(8192); + mp_cstack_init_with_top((void *)0x40000000, 8192); mp_hal_init(); gc_init(heap, heap + sizeof(heap)); mp_init(); diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 0321de45d..17c3ff441 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -52,6 +52,7 @@ #define MICROPY_ALLOC_PARSE_CHUNK_INIT (64) #define MICROPY_DEBUG_PRINTER (&mp_debug_print) #define MICROPY_ENABLE_GC (1) +#define MICROPY_STACK_CHECK_MARGIN (64) #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) #define MICROPY_REPL_EVENT_DRIVEN (0) #define MICROPY_USE_INTERNAL_ERRNO (1) |
