load_mon: remove usage of CONFIG_RAM_SIZE

The define should not be used, as it might be wrong.
This is the case on fmu-v5, which meant that the used RAM was always 1.
This commit is contained in:
Beat Küng
2017-12-07 19:46:37 +01:00
committed by Lorenz Meier
parent f1bd94e25b
commit fa929322ab

View File

@@ -246,14 +246,7 @@ float LoadMon::_ram_used()
// mem.fordblks: free (bytes)
// mem.mxordblk: largest remaining block (bytes)
float load = (float)mem.uordblks / mem.arena;
// Check for corruption of the allocation counters
if ((mem.arena > CONFIG_RAM_SIZE) || (mem.fordblks > CONFIG_RAM_SIZE)) {
load = 1.0f;
}
return load;
return (float)mem.uordblks / mem.arena;
#else
return 0.0f;
#endif