Skip to content

Commit b68574e

Browse files
committed
zephyr/main: Replace mp_stack_set with mp_cstack_init_with_sp_here.
Signed-off-by: Damien George <[email protected]>
1 parent f498ebc commit b68574e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

ports/zephyr/main.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "py/repl.h"
4949
#include "py/gc.h"
5050
#include "py/mphal.h"
51-
#include "py/stackctrl.h"
5251
#include "shared/runtime/gchelper.h"
5352
#include "shared/runtime/pyexec.h"
5453
#include "shared/readline/readline.h"
@@ -129,8 +128,6 @@ static void vfs_init(void) {
129128
#endif // MICROPY_VFS
130129

131130
int real_main(void) {
132-
volatile int stack_dummy = 0;
133-
134131
#if MICROPY_PY_THREAD
135132
struct k_thread *z_thread = (struct k_thread *)k_current_get();
136133
mp_thread_init((void *)z_thread->stack_info.start, z_thread->stack_info.size / sizeof(uintptr_t));
@@ -140,9 +137,7 @@ int real_main(void) {
140137
mp_hal_init();
141138

142139
soft_reset:
143-
mp_stack_set_top((void *)&stack_dummy);
144-
// Make MicroPython's stack limit somewhat smaller than full stack available
145-
mp_stack_set_limit(CONFIG_MAIN_STACK_SIZE - 512);
140+
mp_cstack_init_with_sp_here(CONFIG_MAIN_STACK_SIZE);
146141
#if MICROPY_ENABLE_GC
147142
gc_init(heap, heap + sizeof(heap));
148143
#endif

0 commit comments

Comments
 (0)