summaryrefslogtreecommitdiff
path: root/supervisor/shared/stack.c
diff options
context:
space:
mode:
authorChris Osterwood <osterwood@gmail.com>2020-01-20 13:11:57 -0500
committerChris Osterwood <osterwood@gmail.com>2020-01-20 13:11:57 -0500
commit97420994e85f65a4f2ddb802d532acd56c1e5879 (patch)
tree11709251ee3b05ea46b7d262f3ba0ed28532e8cd /supervisor/shared/stack.c
parent137a4f8a5d21f5e37277031887a3908e6c4e371e (diff)
parent85c731734a0388c28c8e3895ec1cecd1d9491e0c (diff)
Merge remote-tracking branch 'origin/master' into capablerobot-usbhub
Diffstat (limited to 'supervisor/shared/stack.c')
-rwxr-xr-xsupervisor/shared/stack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c
index 311fa31b2..dcecf2067 100755
--- a/supervisor/shared/stack.c
+++ b/supervisor/shared/stack.c
@@ -29,6 +29,7 @@
#include "py/mpconfig.h"
#include "py/runtime.h"
#include "supervisor/cpu.h"
+#include "supervisor/port.h"
#include "supervisor/shared/safe_mode.h"
extern uint32_t _estack;
@@ -43,7 +44,7 @@ void allocate_stack(void) {
mp_uint_t regs[10];
mp_uint_t sp = cpu_get_regs_and_sp(regs);
- mp_uint_t c_size = (uint32_t) &_estack - sp;
+ mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp;
stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true);
if (stack_alloc == NULL) {