FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Utility class to avoid costly instantiation of time::RTTTime
from an interrupt routine.
More...
#include <fastarduino/realtime_timer.h>
Public Member Functions | |
RTTRawTime (uint32_t millis, T counter, T max_counter) | |
Create a new RTTRawTime from millis milliseconds, and values from Timer counter value that will allow microseconds calculation later on. More... | |
time::RTTTime | as_real_time () const |
Convert this RTTRawTime instance to a fully usable time::RTTTime . More... | |
Static Public Attributes | |
static constexpr RTTRawTime< T > | EMPTY_TIME {} |
A constant to signify "no time". More... | |
Utility class to avoid costly instantiation of time::RTTTime
from an interrupt routine.
It can be later (outside an ISR) converted into a real time::RTTTime
.
It is usually created from raw Timer registers values. This type shall usually not be directly used as RTTRawTime<T> but actually obtained from an RTT<NTIMER> instance, as RTT::RAW_TIME
.
T | the type of registers for the Timer providing raw values, either uint8_t or uint16_t |
Definition at line 135 of file realtime_timer.h.
|
inline |
Create a new RTTRawTime
from millis
milliseconds, and values from Timer counter
value that will allow microseconds calculation later on.
millis | the milliseconds elapsed as accounted by an RTT instance |
counter | the counter of the Timer used by the RTT instance |
max_counter | the maximum counter value for the Timer |
Definition at line 152 of file realtime_timer.h.
|
inline |
Convert this RTTRawTime
instance to a fully usable time::RTTTime
.
This method performs potentially costly computation and hence should not be used inside an ISR.
Definition at line 167 of file realtime_timer.h.
|
staticconstexpr |
A constant to signify "no time".
This constant takes no code to build, compared with RTTRawTime{0, 0, 0}
.
Definition at line 160 of file realtime_timer.h.
uint32_t timer::RTTRawTime< T >::millis_ |
Definition at line 182 of file realtime_timer.h.
T timer::RTTRawTime< T >::counter_ |
Definition at line 183 of file realtime_timer.h.
T timer::RTTRawTime< T >::max_counter_ |
Definition at line 184 of file realtime_timer.h.
uint8_t timer::RTTRawTime< T >::buffer_[sizeof(uint32_t)+2 *sizeof(T)] |
Definition at line 186 of file realtime_timer.h.