Skip to content

Commit 12220b8

Browse files
committed
renesas-ra/main: Replace mp_stack_set with mp_cstack_init_with_top.
Signed-off-by: Damien George <[email protected]>
1 parent cbe137c commit 12220b8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

ports/renesas-ra/main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <string.h>
3030

3131
#include "py/runtime.h"
32-
#include "py/stackctrl.h"
3332
#include "py/gc.h"
3433
#include "py/mperrno.h"
3534
#include "py/mphal.h"
@@ -295,11 +294,8 @@ int main(void) {
295294
mp_thread_init();
296295
#endif
297296

298-
// Stack limit should be less than real stack size, so we have a chance
299-
// to recover from limit hit. (Limit is measured in bytes.)
300297
// Note: stack control relies on main thread being initialised above
301-
mp_stack_set_top(&_estack);
302-
mp_stack_set_limit((char *)&_estack - (char *)&_sstack - 1024);
298+
mp_cstack_init_with_top(&_estack, (char *)&_estack - (char *)&_sstack);
303299

304300
// GC init
305301
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);

ports/renesas-ra/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
#define MICROPY_TRACKED_ALLOC (MICROPY_SSL_MBEDTLS || MICROPY_BLUETOOTH_BTSTACK)
9393
#define MICROPY_READER_VFS (1)
9494
#define MICROPY_ENABLE_GC (1)
95+
#define MICROPY_STACK_CHECK_MARGIN (1024)
9596
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
9697
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
9798
#define MICROPY_REPL_INFO (1)

0 commit comments

Comments
 (0)