py/stackctrl: Add mp_stack_set_top() to explicitly set stack top value.
Useful for embedded targets with fixed stack layout.
This commit is contained in:
parent
419bb26ddc
commit
1d5d4f49d9
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user