Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::TimestampTimer Namespace Reference

Utility for microsecond timestamp values. More...

Functions

uint64_t getTimestamp ()
 Returns the current timer value in microseconds.
 

Detailed Description

Utility for microsecond timestamp values.

Deprecated
This namespace provided access to sub-millisecond timestamp values for precise timing requirements before Miosix 2.7, since at that time Miosix only had millisecond-accurate tick values. It has now been deprecated in favor of miosix::getTime() which has nanosecond resolution. The class is kept for compatibility reasons and should be removed in the future.

The old timer used a 32bit value and the TIM2 or TIM5 hardware peripherals, at a frequency of 250KHz. This way the timer had a resolution of 4us, it would overflow after 4.7 hours and only required a 2-bit shift left operation to convert from counter tick to microseconds.

Function Documentation

◆ getTimestamp()

uint64_t Boardcore::TimestampTimer::getTimestamp ( )
inline

Returns the current timer value in microseconds.

Deprecated
Use miosix::getTime() instead and update the code to nanoseconds.
Returns
Current timestamp in microseconds.

Definition at line 57 of file TimestampTimer.h.