stm32/main: Replace mp_stack_set calls with new mp_cstack_init_with_top.

Required in MICROPY_PREVIEW_VERSION_2.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
Andrew Leech
2025-03-26 10:23:55 +11:00
committed by Damien George
parent 569d472bc7
commit d6c673f28f
2 changed files with 3 additions and 5 deletions

View File

@@ -515,11 +515,8 @@ soft_reset:
mp_thread_init();
#endif
// Stack limit should be less than real stack size, so we have a chance
// to recover from limit hit. (Limit is measured in bytes.)
// Note: stack control relies on main thread being initialised above
mp_stack_set_top(&_estack);
mp_stack_set_limit((char *)&_estack - (char *)&_sstack - 1024);
// Stack limit init.
mp_cstack_init_with_top(&_estack, (char *)&_estack - (char *)&_sstack);
// GC init
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);

View File

@@ -43,6 +43,7 @@
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t
#endif
#endif
#define MICROPY_STACK_CHECK_MARGIN (1024)
#define MICROPY_ALLOC_PATH_MAX (128)
// optimisations