diff --git a/libraries/AP_HAL_PX4/Util.cpp b/libraries/AP_HAL_PX4/Util.cpp index dfcc45df25..fd16a34e61 100644 --- a/libraries/AP_HAL_PX4/Util.cpp +++ b/libraries/AP_HAL_PX4/Util.cpp @@ -124,14 +124,9 @@ bool PX4Util::get_system_id(char buf[40]) /** how much free memory do we have in bytes. */ -uint16_t PX4Util::available_memory(void) +uint32_t PX4Util::available_memory(void) { - struct mallinfo mem; - mem = mallinfo(); - if (mem.fordblks > 0xFFFF) { - return 0xFFFF; - } - return mem.fordblks; + return mallinfo().fordblks; } /* diff --git a/libraries/AP_HAL_PX4/Util.h b/libraries/AP_HAL_PX4/Util.h index c082914f9e..9a6fb7ad6f 100644 --- a/libraries/AP_HAL_PX4/Util.h +++ b/libraries/AP_HAL_PX4/Util.h @@ -45,7 +45,7 @@ public: */ bool get_system_id(char buf[40]); - uint16_t available_memory(void); + uint32_t available_memory(void) override; /* return a stream for access to nsh shell