From 022c222e858665054ca5cded512ae085da7939d0 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 22 Sep 2023 09:30:28 +1000 Subject: [PATCH] Add heap stats to the task stats output --- src/app_console/app_console.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp index 2d287e5d..55b51690 100644 --- a/src/app_console/app_console.cpp +++ b/src/app_console/app_console.cpp @@ -26,6 +26,7 @@ #include "esp_console.h" #include "esp_intr_alloc.h" #include "esp_log.h" +#include "esp_system.h" #include "event_queue.hpp" #include "ff.h" #include "freertos/FreeRTOSConfig_arch.h" @@ -427,6 +428,11 @@ int CmdTaskStats(int argc, char** argv) { delete[] start_status; delete[] end_status; + std::cout << "heap stats:" << std::endl; + std::cout << (esp_get_free_heap_size() / 1024) << " KiB free" << std::endl; + std::cout << (esp_get_minimum_free_heap_size() / 1024) + << " KiB free at lowest" << std::endl; + return 0; }