From 4904098944358a1754576b836b94e2cb319fab9c Mon Sep 17 00:00:00 2001 From: "@CarlWachter" Date: Wed, 24 Jan 2024 21:21:59 +0100 Subject: [PATCH] Minor adjustments --- include/sta/rtos/debug/heap_stats.hpp | 2 +- src/debug/heap_stats.cpp | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/sta/rtos/debug/heap_stats.hpp b/include/sta/rtos/debug/heap_stats.hpp index 210aed9..e5d8d9a 100644 --- a/include/sta/rtos/debug/heap_stats.hpp +++ b/include/sta/rtos/debug/heap_stats.hpp @@ -11,7 +11,7 @@ #include -#ifdef STA_DEBUGGING_ENABLED +#ifdef STA_DEBUGGING_ENABLED_NP #include diff --git a/src/debug/heap_stats.cpp b/src/debug/heap_stats.cpp index 7f9cf4a..29823f2 100644 --- a/src/debug/heap_stats.cpp +++ b/src/debug/heap_stats.cpp @@ -7,7 +7,7 @@ #include -#ifdef STA_DEBUGGING_ENABLED +#ifdef STA_DEBUGGING_ENABLED_NP #include #include @@ -19,40 +19,24 @@ namespace sta { size_t getAvailableHeapSpace() { - xHeapStats stats; - vPortGetHeapStats(&stats); - return stats.xAvailableHeapSpaceInBytes; } size_t getNumAllocs() { - xHeapStats stats; - vPortGetHeapStats(&stats); return stats.xNumberOfSuccessfulAllocations; } size_t getNumFrees() { - xHeapStats stats; - vPortGetHeapStats(&stats); return stats.xNumberOfSuccessfulFrees; } void printHeapStats() { - xHeapStats stats; - vPortGetHeapStats(&stats); - STA_DEBUG_PRINTF( - "[HEAP STATS] \n Available: %d\n Lowest: %d\n Mallocs: %d\n Frees: %d", - stats.xAvailableHeapSpaceInBytes, - stats.xMinimumEverFreeBytesRemaining, - stats.xNumberOfSuccessfulAllocations, - stats.xNumberOfSuccessfulFrees - ); } } // namespace rtos } // namespace sta