Skip to content

Commit 639150e

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

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ports/samd/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "py/gc.h"
3030
#include "py/mperrno.h"
3131
#include "py/mphal.h"
32-
#include "py/stackctrl.h"
3332
#include "extmod/modmachine.h"
3433
#include "shared/readline/readline.h"
3534
#include "shared/runtime/gchelper.h"
@@ -45,8 +44,7 @@ extern void pwm_deinit_all(void);
4544
extern void sercom_deinit_all(void);
4645

4746
void samd_main(void) {
48-
mp_stack_set_top(&_estack);
49-
mp_stack_set_limit(&_estack - &_sstack - 1024);
47+
mp_cstack_init_with_top(&_estack, &_estack - &_sstack);
5048
mp_hal_time_ns_set_from_rtc();
5149

5250
for (;;) {

ports/samd/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
// Python internal features
4343
#define MICROPY_ENABLE_GC (1)
44+
#define MICROPY_STACK_CHECK_MARGIN (1024)
4445
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
4546
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
4647
#ifndef MICROPY_PY_BUILTINS_COMPLEX

0 commit comments

Comments
 (0)