mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
Add runtime stats hook module
This commit is contained in:
parent
4e355d244b
commit
b1539aab39
20
src/runtime_stats.c
Normal file
20
src/runtime_stats.c
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include <sta/config.hpp>
|
||||||
|
#ifdef STA_RTOS_STM32_RUNTIME_TIM
|
||||||
|
|
||||||
|
#include <tim.h>
|
||||||
|
|
||||||
|
|
||||||
|
void configureTimerForRunTimeStats()
|
||||||
|
{
|
||||||
|
// Start timer base
|
||||||
|
HAL_TIM_Base_Start(&STA_RTOS_STM32_RUNTIME_TIM);
|
||||||
|
// Reset timer
|
||||||
|
__HAL_TIM_SET_COUNTER(&STA_RTOS_STM32_RUNTIME_TIM, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long getRunTimeCounterValue()
|
||||||
|
{
|
||||||
|
return __HAL_TIM_GET_COUNTER(&STA_RTOS_STM32_RUNTIME_TIM);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // STA_RTOS_STM32_RUNTIME_TIM
|
Loading…
x
Reference in New Issue
Block a user