summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--py/stackctrl.c4
-rw-r--r--py/stackctrl.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/py/stackctrl.c b/py/stackctrl.c
index 4c51653727..14d1fd0429 100644
--- a/py/stackctrl.c
+++ b/py/stackctrl.c
@@ -35,6 +35,10 @@ void mp_stack_ctrl_init(void) {
MP_STATE_VM(stack_top) = (char*)&stack_dummy;
}
+void mp_stack_set_top(void *top) {
+ MP_STATE_VM(stack_top) = top;
+}
+
mp_uint_t mp_stack_usage(void) {
// Assumes descending stack
volatile int stack_dummy;
diff --git a/py/stackctrl.h b/py/stackctrl.h
index bd18f21426..e915f5000f 100644
--- a/py/stackctrl.h
+++ b/py/stackctrl.h
@@ -29,6 +29,7 @@
#include "py/mpconfig.h"
void mp_stack_ctrl_init(void);
+void mp_stack_set_top(void *top);
mp_uint_t mp_stack_usage(void);
#if MICROPY_STACK_CHECK