Skip to content

Commit fa2d13d

Browse files
committed
ports/stm32/main: Replace mp_stack_set settings with mp_cstack_init.
Required in MICROPY_PREVIEW_VERSION_2 Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent 06d4892 commit fa2d13d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ports/stm32/main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,8 @@ void stm32_main(uint32_t reset_mode) {
508508
mp_thread_init();
509509
#endif
510510

511-
// Stack limit should be less than real stack size, so we have a chance
512-
// to recover from limit hit. (Limit is measured in bytes.)
513-
// Note: stack control relies on main thread being initialised above
514-
mp_stack_set_top(&_estack);
515-
mp_stack_set_limit((char *)&_estack - (char *)&_sstack - 1024);
511+
// Stack limit init.
512+
mp_cstack_init_with_top(&_estack, (char *)&_estack - (char *)&_sstack);
516513

517514
// GC init
518515
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);

0 commit comments

Comments
 (0)