Time Event class. More...
#include "qp.hpp"
Public Member Functions | |
QTimeEvt (QActive *const act, QSignal const sig, std::uint_fast8_t const tickRate=0U) noexcept | |
The "extended" constructor to initialize a Time Event. | |
void | armX (std::uint32_t const nTicks, std::uint32_t const interval=0U) noexcept |
bool | disarm () noexcept |
bool | rearm (std::uint32_t const nTicks) noexcept |
bool | wasDisarmed () noexcept |
void const * | getAct () const noexcept |
QTimeEvtCtr | getCtr () const noexcept |
QTimeEvtCtr | getInterval () const noexcept |
std::uint8_t | getTickRate () const noexcept |
QActive * | toActive () noexcept |
QTimeEvt * | toTimeEvt () noexcept |
Public Member Functions inherited from QP::QEvt | |
constexpr | QEvt (QSignal const s) noexcept |
QEvt ()=delete | |
void | init () noexcept |
void | init (DynEvt const dummy) noexcept |
bool | verify_ () const noexcept |
Internal function to verify the internal integrity of the event instance (QP FuSa Subsystem) | |
std::uint_fast8_t | getPoolNum_ () const noexcept |
Internal function to get the event pool-number of the given event. | |
Static Public Member Functions | |
static void | tick (std::uint_fast8_t const tickRate, void const *const sender) noexcept |
static void | tick1_ (std::uint_fast8_t const tickRate, void const *const sender) |
static void | tickFromISR (std::uint_fast8_t const tickRate, void *par, void const *sender) noexcept |
static bool | noActive (std::uint_fast8_t const tickRate) noexcept |
Static Public Attributes | |
static QTimeEvt | timeEvtHead_ [QF_MAX_TICK_RATE] |
static QPtrDis | timeEvtHead_dis_ [QF_MAX_TICK_RATE] |
Private Member Functions | |
QTimeEvt () noexcept | |
QTimeEvt (QTimeEvt const &other)=delete | |
QTimeEvt & | operator= (QTimeEvt const &other)=delete |
Private Attributes | |
QTimeEvt *volatile | m_next |
Link to the next time event in the list. | |
std::uintptr_t | m_next_dis |
void * | m_act |
Active object that receives the time events. | |
QTimeEvtCtr volatile | m_ctr |
Down-counter of the time event. | |
QTimeEvtCtr | m_ctr_dis |
QTimeEvtCtr | m_interval |
Interval for periodic time event (zero for one-shot time event) | |
std::uint8_t | m_tickRate |
std::uint8_t | m_flags |
Friends | |
class | QXThread |
Additional Inherited Members | |
Public Types inherited from QP::QEvt | |
enum | DynEvt : std::uint8_t { DYNAMIC } |
Public Attributes inherited from QP::QEvt | |
QSignal | sig |
Signal of the event (see Event Signal) | |
std::uint8_t | evtTag_ |
Event "tag" contains pool-ID plus the Duplicate Inverted Storage of the QEvt::refCtr_. | |
std::uint8_t volatile | refCtr_ |
Event reference counter.) | |
Time Event class.
Time events, as any other QF events derive from the QP::QEvt base class. Typically, you will use a time event as-is, but you can also further derive more specialized time events from it by adding some more data members and/or specialized functions that operate on the specialized time events.
Internally, the armed time events are organized into linked lists–one list for every supported ticking rate. These linked lists are scanned in every invocation of the QTIMEEVT_TICK_X() macro. Only armed (timing out) time events are in the list, so only armed time events consume CPU cycles.
|
noexcept |
The "extended" constructor to initialize a Time Event.
act
, tick rate tickRate
and event signal sig
. You cannot change these attributes later.[in] | act | pointer to the active object associated with this time event. The time event will post itself to this AO. |
[in] | sig | signal to associate with this time event. |
[in] | tickRate | system clock tick rate to associate with this time event in the range [0..15]. |
qf_time:300
sig
must be validtickRate
must be in range Definition at line 68 of file qf_time.cpp.
|
privatenoexcept |
Definition at line 541 of file qf_time.cpp.
|
privatedelete |
|
noexcept |
Arm a time event (extended version for one shot or periodic time event)
A time event can be disarmed at any time by calling QTimeEvt_disarm(). Also, a time event can be re-armed to fire in a different number of clock ticks by calling the QTimeEvt_rearm().
[in] | nTicks | number of clock ticks (at the associated rate) to rearm the time event with. |
[in] | interval | interval (in clock ticks) for periodic time event. |
qf_time:400
Definition at line 98 of file qf_time.cpp.
|
noexcept |
Disarm a time event.
Definition at line 183 of file qf_time.cpp.
|
noexcept |
Rearm a time event.
[in] | nTicks | number of clock ticks (at the associated rate) to rearm the time event with. |
qf_time:600
Definition at line 237 of file qf_time.cpp.
|
noexcept |
Check the "was disarmed" status of a time event.
Definition at line 326 of file qf_time.cpp.
|
inlinenoexcept |
Get the current value of the down-counter of a time event.
|
inlinenoexcept |
|
inlinenoexcept |
|
staticnoexcept |
Processes all armed time events at every clock tick.
tickRate
.This function must be called periodically from a time-tick ISR or from a task so that QF can manage the timeout events assigned to the given system clock tick rate.
[in] | tickRate | clock tick rate serviced in this call [1..15]. |
[in] | sender | pointer to a sender object (only for QS tracing) |
tickRate
parameter can preempt each other. For example, higher clock tick rates might be serviced from interrupts while others from tasks (active objects).Definition at line 341 of file qf_time.cpp.
|
static |
Processes one clock tick for QUTest
|
staticnoexcept |
|
staticnoexcept |
Check if any time events are active at a given clock tick rate.
[in] | tickRate | system clock tick rate to find out about. |
qf_time:800
Definition at line 521 of file qf_time.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |