mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-10 18:15:59 +00:00
Minor adjustments
This commit is contained in:
parent
ff1cbf8473
commit
4904098944
@ -11,7 +11,7 @@
|
||||
#include <sta/config.hpp>
|
||||
|
||||
|
||||
#ifdef STA_DEBUGGING_ENABLED
|
||||
#ifdef STA_DEBUGGING_ENABLED_NP
|
||||
|
||||
#include <sta/debug/debug.hpp>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <sta/rtos/debug/heap_stats.hpp>
|
||||
|
||||
#ifdef STA_DEBUGGING_ENABLED
|
||||
#ifdef STA_DEBUGGING_ENABLED_NP
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <cmsis_os2.h>
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user