Skip to content

Commit 76efdfa

Browse files
committed
alif/main: Replace mp_stack_set with mp_cstack_init_with_top.
Signed-off-by: Damien George <[email protected]>
1 parent b68574e commit 76efdfa

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ports/alif/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/modbluetooth.h"
3433
#include "extmod/modmachine.h"
3534
#include "extmod/modnetwork.h"
@@ -92,8 +91,7 @@ int main(void) {
9291
#endif
9392

9493
// Initialise stack extents and GC heap.
95-
mp_stack_set_top(&__StackTop);
96-
mp_stack_set_limit(&__StackTop - &__StackLimit - 1024);
94+
mp_cstack_init_with_top(&__StackTop, &__StackTop - &__StackLimit);
9795
gc_init(&__GcHeapStart, &__GcHeapEnd);
9896

9997
#if MICROPY_PY_LWIP

ports/alif/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
// Python internal features
9898
#define MICROPY_READER_VFS (1)
9999
#define MICROPY_ENABLE_GC (1)
100+
#define MICROPY_STACK_CHECK_MARGIN (1024)
100101
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
101102
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
102103
#ifndef MICROPY_FLOAT_IMPL

0 commit comments

Comments
 (0)