From ac1c0bba154f0613cfaa3fbd5e743c9da73f4ffd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 Nov 2015 15:41:25 +1100 Subject: [PATCH] HAL_PX4: make available_memory() uint32_t --- libraries/AP_HAL_PX4/Util.cpp | 9 ++------- libraries/AP_HAL_PX4/Util.h | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) 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