Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Tick::Scaler_t Struct Reference

Public Member Functions

void init (uint32_t uDesiredRate) noexcept
 Constuctor.
 
uint32_t read (void) noexcept
 Read a tick value at the desired scale.
 

Public Attributes

uint64_t m_uMark
 Time mark for scaled hertz tick.
 
uint64_t m_uDelta
 Pending time delta tick.
 
uint32_t m_uTick
 Current tick.
 
uint32_t m_uDesiredRate
 Desired tick rate 60, 1000, 1000000.
 

Member Function Documentation

◆ init()

void BURGER_API Burger::Tick::Scaler_t::init ( uint32_t uDesiredRate)
noexcept

Constuctor.


Initialize the scaler with the desired tick rate in ticks per second. Any value but zero can be used.

Parameters
uDesiredRateNumber of ticks per second to scale to

◆ read()

uint32_t BURGER_API Burger::Tick::Scaler_t::read ( void )
noexcept

Read a tick value at the desired scale.


Read a high precision timer and through some math magic, convert it to the desired tick rate in ticks per second. The code is accurate and handles a full 32 bit range of values.

Returns
Value that increments at the desireed ticks per second

Member Data Documentation

◆ m_uDelta

uint64_t Burger::Tick::Scaler_t::m_uDelta

Pending time delta tick.

◆ m_uDesiredRate

uint32_t Burger::Tick::Scaler_t::m_uDesiredRate

Desired tick rate 60, 1000, 1000000.

◆ m_uMark

uint64_t Burger::Tick::Scaler_t::m_uMark

Time mark for scaled hertz tick.

◆ m_uTick

uint32_t Burger::Tick::Scaler_t::m_uTick

Current tick.