From f3151bb6c4adac5ed9cf03d3977ab6d9662c0e05 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Fri, 18 Oct 2019 11:05:08 +0200 Subject: Use get top and limit stack functions --- supervisor/shared/stack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'supervisor/shared/stack.c') 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) { -- cgit v1.2.3