Commit fbc19596 authored by Angus Gratton's avatar Angus Gratton Committed by Damien George

rp2: Switch to use new cstack API for stack limit checks.

This work was funded through GitHub Sponsors.
Signed-off-by: default avatarAngus Gratton <angus@redyak.com.au>
parent 80616aee
......@@ -27,11 +27,11 @@
#include <stdio.h>
#include "py/compile.h"
#include "py/cstack.h"
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mperrno.h"
#include "py/mphal.h"
#include "py/stackctrl.h"
#include "extmod/modbluetooth.h"
#include "extmod/modnetwork.h"
#include "shared/readline/readline.h"
......@@ -114,8 +114,7 @@ int main(int argc, char **argv) {
mp_hal_time_ns_set_from_rtc();
// Initialise stack extents and GC heap.
mp_stack_set_top(&__StackTop);
mp_stack_set_limit(&__StackTop - &__StackBottom - 256);
mp_cstack_init_with_top(&__StackTop, &__StackTop - &__StackBottom);
gc_init(&__GcHeapStart, &__GcHeapEnd);
#if MICROPY_PY_LWIP
......
......@@ -81,6 +81,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 (256)
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment