summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/nrf/main.c7
-rw-r--r--ports/nrf/mpconfigport.h1
2 files changed, 2 insertions, 6 deletions
diff --git a/ports/nrf/main.c b/ports/nrf/main.c
index 21a71c7c9..e5d7828a8 100644
--- a/ports/nrf/main.c
+++ b/ports/nrf/main.c
@@ -36,7 +36,6 @@
#include "py/parse.h"
#include "py/obj.h"
#include "py/runtime.h"
-#include "py/stackctrl.h"
#include "py/gc.h"
#include "py/compile.h"
#include "py/persistentcode.h"
@@ -126,11 +125,7 @@ soft_reset:
led_state(1, 1); // MICROPY_HW_LED_1 aka MICROPY_HW_LED_RED
- mp_stack_set_top(&_ram_end);
-
- // Stack limit should be less than real stack size, so we have a chance
- // to recover from limit hit. (Limit is measured in bytes.)
- mp_stack_set_limit((char *)&_ram_end - (char *)&_heap_end - 400);
+ mp_cstack_init_with_top(&_ram_end, (char *)&_ram_end - (char *)&_heap_end);
machine_init();
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index d361d01cc..4ad0a2d3d 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -120,6 +120,7 @@
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_STACK_CHECK (1)
+#define MICROPY_STACK_CHECK_MARGIN (400)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_REPL_INFO (1)
#define MICROPY_REPL_AUTO_INDENT (1)