mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 14:16:40 +00:00
Add freememory
This commit is contained in:
parent
2f038eddd1
commit
7916b4d639
@ -139,12 +139,16 @@ void PosixDevice::update_backlight()
|
|||||||
|
|
||||||
size_t PosixDevice::get_free_max_block()
|
size_t PosixDevice::get_free_max_block()
|
||||||
{
|
{
|
||||||
return 0;
|
struct sysinfo s_info;
|
||||||
|
if(sysinfo(&s_info) < 0) return 0;
|
||||||
|
return s_info.freeram;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t PosixDevice::get_free_heap(void)
|
size_t PosixDevice::get_free_heap(void)
|
||||||
{
|
{
|
||||||
return 0;
|
struct sysinfo s_info;
|
||||||
|
if(sysinfo(&s_info) < 0) return 0;
|
||||||
|
return s_info.freeram;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t PosixDevice::get_heap_fragmentation()
|
uint8_t PosixDevice::get_heap_fragmentation()
|
||||||
@ -165,10 +169,8 @@ bool PosixDevice::is_system_pin(uint8_t pin)
|
|||||||
long PosixDevice::get_uptime()
|
long PosixDevice::get_uptime()
|
||||||
{
|
{
|
||||||
struct sysinfo s_info;
|
struct sysinfo s_info;
|
||||||
if(sysinfo(&s_info) == 0)
|
if(sysinfo(&s_info) < 0) return 0;
|
||||||
return s_info.uptime;
|
return s_info.uptime;
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dev
|
} // namespace dev
|
||||||
|
Loading…
x
Reference in New Issue
Block a user