mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Add an automatic lv_mem_defrag
This commit is contained in:
parent
1380345e6e
commit
0fa68d14b2
@ -338,6 +338,8 @@ static void debugPrintLvglMemory(int level, Print* _logOutput)
|
|||||||
lv_mem_monitor_t mem_mon;
|
lv_mem_monitor_t mem_mon;
|
||||||
lv_mem_monitor(&mem_mon);
|
lv_mem_monitor(&mem_mon);
|
||||||
|
|
||||||
|
if(mem_mon.frag_pct > 20) lv_mem_defrag(); // prevents LED shadow crashing
|
||||||
|
|
||||||
/* Print LVGL Memory Info */
|
/* Print LVGL Memory Info */
|
||||||
if(debugAnsiCodes) {
|
if(debugAnsiCodes) {
|
||||||
if(mem_mon.free_biggest_size > (1024u * 2) && (mem_mon.free_size > 1024u * 2.5) && (mem_mon.frag_pct <= 10))
|
if(mem_mon.free_biggest_size > (1024u * 2) && (mem_mon.free_size > 1024u * 2.5) && (mem_mon.frag_pct <= 10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user