nrf/main: Replace mp_stack_set calls with mp_cstack_init_with_top.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-09-26 00:42:39 +10:00
parent af22318961
commit 816074339a
2 changed files with 2 additions and 6 deletions

View File

@@ -36,7 +36,6 @@
#include "py/parse.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
#include "py/gc.h"
#include "py/compile.h"
#include "py/persistentcode.h"
@@ -126,11 +125,7 @@ soft_reset:
led_state(1, 1); // MICROPY_HW_LED_1 aka MICROPY_HW_LED_RED
mp_stack_set_top(&_ram_end);
// Stack limit should be less than real stack size, so we have a chance
// to recover from limit hit. (Limit is measured in bytes.)
mp_stack_set_limit((char *)&_ram_end - (char *)&_heap_end - 400);
mp_cstack_init_with_top(&_ram_end, (char *)&_ram_end - (char *)&_heap_end);
machine_init();

View File

@@ -120,6 +120,7 @@
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_STACK_CHECK_MARGIN (400)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_REPL_INFO (1)
#define MICROPY_REPL_AUTO_INDENT (1)