Commander: signal high memory usage

This commit is contained in:
Lorenz Meier
2016-08-15 14:54:27 +02:00
parent 8934aaa912
commit 1a9688c42f
2 changed files with 14 additions and 5 deletions

View File

@@ -178,7 +178,7 @@ void LoadMon::_compute()
float LoadMon::_ram_used()
{
#ifdef _PX4_NUTTX
#ifdef __PX4_NUTTX
struct mallinfo mem;
#ifdef CONFIG_CAN_PASS_STRUCTS
@@ -196,8 +196,10 @@ float LoadMon::_ram_used()
// Check for corruption of the allocation counters
if ((mem.arena > CONFIG_DRAM_SIZE) || (mem.fordblks > CONFIG_DRAM_SIZE)) {
return 1.0f;
load = 1.0f;
}
return load;
#else
return 0.0f;
#endif