diff --git a/libraries/memcheck/memcheck.cpp b/libraries/memcheck/memcheck.cpp index e9cc164481..289c771fd1 100644 --- a/libraries/memcheck/memcheck.cpp +++ b/libraries/memcheck/memcheck.cpp @@ -41,7 +41,7 @@ void memcheck_update_stackptr(void) */ void memcheck_init(void) { -#if CONFIG_HAL_BOARD != HAL_BOARD_AVR_SITL +#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 uint32_t *p; free(malloc(1)); // ensure heap is initialised stack_low = current_stackptr(); @@ -58,13 +58,13 @@ void memcheck_init(void) */ unsigned memcheck_available_memory(void) { -#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL - return 0x1000; -#else +#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 memcheck_update_stackptr(); while (*stack_low != SENTINEL && stack_low > (const uint32_t *)__brkval) { stack_low--; } return (uintptr_t)(stack_low) - __brkval; +#else + return 0x1000; #endif }