memcheck: fixed for PX4 build

This commit is contained in:
Andrew Tridgell 2013-01-02 14:44:29 +11:00
parent f9ab781d57
commit d0ae51e92a

View File

@ -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
}