Move runtime stats debug helper

This commit is contained in:
Henrik Stickann
2023-01-20 03:28:06 +01:00
parent 61d586ae47
commit 5cf9b25491

20
src/debug/runtime_stats.c Normal file
View File

@@ -0,0 +1,20 @@
#include <sta/config.hpp>
#ifdef STA_RTOS_RUNTIME_STATS_TIM
#include <tim.h>
void configureTimerForRunTimeStats()
{
// Start timer base
HAL_TIM_Base_Start(&STA_RTOS_RUNTIME_STATS_TIM);
// Reset timer
__HAL_TIM_SET_COUNTER(&STA_RTOS_RUNTIME_STATS_TIM, 0);
}
unsigned long getRunTimeCounterValue()
{
return __HAL_TIM_GET_COUNTER(&STA_RTOS_RUNTIME_STATS_TIM);
}
#endif // STA_RTOS_RUNTIME_STATS_TIM