From 45f5e8805436a0d37f7a1cc00eba48afad1a0a64 Mon Sep 17 00:00:00 2001 From: Be Date: Sun, 6 Apr 2025 01:19:35 -0500 Subject: app console: add LVGL heap to heap stats --- src/tangara/app_console/app_console.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tangara/app_console/app_console.cpp b/src/tangara/app_console/app_console.cpp index 49cb9788..dcefc966 100644 --- a/src/tangara/app_console/app_console.cpp +++ b/src/tangara/app_console/app_console.cpp @@ -44,6 +44,7 @@ #include "database/track.hpp" #include "events/event_queue.hpp" #include "lua/lua_registry.hpp" +#include "lvgl/src/stdlib/lv_mem.h" #include "system_fsm/service_locator.hpp" #include "system_fsm/system_events.hpp" #include "ui/ui_events.hpp" @@ -373,6 +374,14 @@ int CmdHeaps(int argc, char** argv) { std::cout << (heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM) / 1024) << " KiB largest free block" << std::endl; + lv_mem_monitor_t lvgl_heap_stats; + lv_mem_monitor(&lvgl_heap_stats); + std::cout << "heap stats (LVGL):" << std::endl; + std::cout << lvgl_heap_stats.free_size / 1024 + << " KiB free" << std::endl; + std::cout << lvgl_heap_stats.free_biggest_size / 1024 + << " KiB largest free block" << std::endl; + return 0; } -- cgit v1.2.3