renesas-ra/main: Replace mp_stack_set 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:53:25 +10:00
parent cbe137c4b8
commit 12220b821e
2 changed files with 2 additions and 5 deletions

View File

@@ -29,7 +29,6 @@
#include <string.h>
#include "py/runtime.h"
#include "py/stackctrl.h"
#include "py/gc.h"
#include "py/mperrno.h"
#include "py/mphal.h"
@@ -295,11 +294,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);
mp_cstack_init_with_top(&_estack, (char *)&_estack - (char *)&_sstack);
// GC init
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);

View File

@@ -92,6 +92,7 @@
#define MICROPY_TRACKED_ALLOC (MICROPY_SSL_MBEDTLS || MICROPY_BLUETOOTH_BTSTACK)
#define MICROPY_READER_VFS (1)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_STACK_CHECK_MARGIN (1024)
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
#define MICROPY_REPL_INFO (1)