diff --git a/stm-firmware/include/reflow-controller/stack-check.h b/stm-firmware/include/reflow-controller/stack-check.h index f73dd29..8e0e290 100644 --- a/stm-firmware/include/reflow-controller/stack-check.h +++ b/stm-firmware/include/reflow-controller/stack-check.h @@ -29,6 +29,18 @@ int32_t stack_check_get_usage(); int32_t stack_check_get_free(); +static inline int stack_check_collision() +{ + int ret = 0; + int32_t free_space = stack_check_get_free(); + + if ((unsigned int)free_space < STACK_CHECK_MIN_HEAP_GAP) { + ret = -1; + } + + return ret; +} + static inline uint32_t read_stack_pointer() { uint32_t stack_pointer;