HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
|
Workload estimation utilities. More...
#include <stdio.h>
#include "sarmfsw.h"
#include "TIM_ex.h"
#include "tick_utils.h"
#include "workload.h"
Functions | |
float | get_Workload_load_perc (const eWorkload_val type) |
Get interrupts load percentage. | |
uint32_t | get_Workload_loop_period (const eWorkload_val type) |
Get main loop period. | |
FctERR | Workload_init (void) |
Init Workload functionalities. | |
void | set_Workload_ticks_us (const float ticks) |
Set number of timer ticks in a µs. | |
void | set_Workload_window (const uint32_t per) |
Set workload estimation time window (in ms) | |
void | Workload_handler (void) |
Workload handler. | |
void | Workload_show_results (void) |
Print workload results. | |
Variables | |
volatile uint32_t | it_ticks_accumulator = 0 |
volatile uint32_t | it_ticks_start |
volatile bool | it_counts_ongoing = false |
Workload estimation utilities.
Handler has to be called in the main sequential loop (or in a periodic task). Init function has to be called prior to main loop. WORLOAD_IT_IN macro has to be put at the start of every interrupt, WORLOAD_IT_OUT macro before return of every interrupt
float get_Workload_load_perc | ( | const eWorkload_val | type | ) |
Get interrupts load percentage.
[in] | type | - Type to get |
uint32_t get_Workload_loop_period | ( | const eWorkload_val | type | ) |
Get main loop period.
[in] | type | - Type to get |
void set_Workload_ticks_us | ( | const float | ticks | ) |
Set number of timer ticks in a µs.
[in] | ticks | - Ticks in a µs |
void set_Workload_window | ( | const uint32_t | per | ) |
Set workload estimation time window (in ms)
[in] | per | - Time window in ms |
void Workload_handler | ( | void | ) |
Workload handler.
FctERR Workload_init | ( | void | ) |
Init Workload functionalities.
void Workload_show_results | ( | void | ) |
Print workload results.
volatile bool it_counts_ongoing = false |
volatile uint32_t it_ticks_accumulator = 0 |
volatile uint32_t it_ticks_start |