mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
Minor adjustments
This commit is contained in:
parent
ff1cbf8473
commit
4904098944
@ -11,7 +11,7 @@
|
|||||||
#include <sta/config.hpp>
|
#include <sta/config.hpp>
|
||||||
|
|
||||||
|
|
||||||
#ifdef STA_DEBUGGING_ENABLED
|
#ifdef STA_DEBUGGING_ENABLED_NP
|
||||||
|
|
||||||
#include <sta/debug/debug.hpp>
|
#include <sta/debug/debug.hpp>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <sta/rtos/debug/heap_stats.hpp>
|
#include <sta/rtos/debug/heap_stats.hpp>
|
||||||
|
|
||||||
#ifdef STA_DEBUGGING_ENABLED
|
#ifdef STA_DEBUGGING_ENABLED_NP
|
||||||
|
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include <cmsis_os2.h>
|
#include <cmsis_os2.h>
|
||||||
@ -19,40 +19,24 @@ namespace sta
|
|||||||
{
|
{
|
||||||
size_t getAvailableHeapSpace()
|
size_t getAvailableHeapSpace()
|
||||||
{
|
{
|
||||||
xHeapStats stats;
|
|
||||||
vPortGetHeapStats(&stats);
|
|
||||||
|
|
||||||
return stats.xAvailableHeapSpaceInBytes;
|
return stats.xAvailableHeapSpaceInBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t getNumAllocs()
|
size_t getNumAllocs()
|
||||||
{
|
{
|
||||||
xHeapStats stats;
|
|
||||||
vPortGetHeapStats(&stats);
|
|
||||||
|
|
||||||
return stats.xNumberOfSuccessfulAllocations;
|
return stats.xNumberOfSuccessfulAllocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t getNumFrees()
|
size_t getNumFrees()
|
||||||
{
|
{
|
||||||
xHeapStats stats;
|
|
||||||
vPortGetHeapStats(&stats);
|
|
||||||
|
|
||||||
return stats.xNumberOfSuccessfulFrees;
|
return stats.xNumberOfSuccessfulFrees;
|
||||||
}
|
}
|
||||||
|
|
||||||
void printHeapStats()
|
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 rtos
|
||||||
} // namespace sta
|
} // namespace sta
|
||||||
|
Loading…
x
Reference in New Issue
Block a user