5 #include "./../software/pseudoSerial.hpp"
24 void static init() __attribute__((always_inline))
26 ARM_DEMCR |= ARM_DEMCR_TRCENA;
27 ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;
31 void start() __attribute__((always_inline))
37 void end() __attribute__((always_inline))
39 volatile uint32_t now = ARM_DWT_CYCCNT;
57 void reset() __attribute__((always_inline))
64 void output() __attribute__((always_inline))
66 float_t mean_ =
mean();
67 Serial.write((char8cast_t*)&(mean_),
sizeof(float_t));
Performance Counter class for teensy 4.1 microcontrollers.
Definition: perf_counter.hpp:13
void output() __attribute__((always_inline))
Definition: perf_counter.hpp:64
uint32_t last_duration()
Returns the last recorded duration.
Definition: perf_counter.hpp:52
float mean()
Returns the mean number of cycles between start() and stop().
Definition: perf_counter.hpp:46
void start() __attribute__((always_inline))
Start Measurement.
Definition: perf_counter.hpp:31
uint32_t Cycles
Last recorded duration (difference in clock cycles recorded)
Definition: perf_counter.hpp:18
void reset() __attribute__((always_inline))
Definition: perf_counter.hpp:57
uint32_t Count
Count for mean calculation.
Definition: perf_counter.hpp:17
void end() __attribute__((always_inline))
End measurement.
Definition: perf_counter.hpp:37
uint32_t Stack
Stack for mean calculation.
Definition: perf_counter.hpp:16
uint32_t StartTime
Stored starting time of the measurement.
Definition: perf_counter.hpp:19
static void init() __attribute__((always_inline))
Set up the debug module for clock cycle counting.
Definition: perf_counter.hpp:24