Skip to content

Commit af22318

Browse files
committed
mimxrt/main: Replace mp_stack_set calls with mp_cstack_init_with_top.
Signed-off-by: Damien George <[email protected]>
1 parent 2399b4e commit af22318

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ports/mimxrt/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "py/runtime.h"
3030
#include "py/gc.h"
3131
#include "py/mperrno.h"
32-
#include "py/stackctrl.h"
3332
#include "shared/readline/readline.h"
3433
#include "shared/runtime/gchelper.h"
3534
#include "shared/runtime/pyexec.h"
@@ -100,8 +99,7 @@ int main(void) {
10099
led_init();
101100
#endif
102101

103-
mp_stack_set_top(&_estack);
104-
mp_stack_set_limit(&_estack - &_sstack - 1024);
102+
mp_cstack_init_with_top(&_estack, &_estack - &_sstack);
105103

106104
gc_init(&_gc_heap_start, &_gc_heap_end);
107105
mp_init();

ports/mimxrt/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ uint32_t trng_random_u32(void);
5454
#define MICROPY_TRACKED_ALLOC (MICROPY_SSL_MBEDTLS)
5555
#define MICROPY_READER_VFS (1)
5656
#define MICROPY_ENABLE_GC (1)
57+
#define MICROPY_STACK_CHECK_MARGIN (1024)
5758
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
5859
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
5960
#define MICROPY_SCHEDULER_DEPTH (8)

0 commit comments

Comments
 (0)