mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
memcheck: fixed for PX4 build
This commit is contained in:
parent
f9ab781d57
commit
d0ae51e92a
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user