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 | |
void | armX (QTimeEvtCtr const nTicks, QTimeEvtCtr const interval=0U) noexcept |
bool | disarm () noexcept |
bool | rearm (QTimeEvtCtr const nTicks) noexcept |
bool | wasDisarmed () noexcept |
void const * | getAct () const noexcept |
QTimeEvtCtr | getCtr () const noexcept |
QTimeEvtCtr | getInterval () const noexcept |
QActive * | toActive () noexcept |
QTimeEvt * | toTimeEvt () noexcept |
Public Member Functions inherited from QP::QEvt | |
QEvt * | ctor (DynEvt const dummy) noexcept |
constexpr | QEvt (QSignal const s) noexcept |
QEvt ()=delete | |
std::uint_fast8_t | getPoolNum_ () const noexcept |
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 Member Functions inherited from QP::QEvt | |
static bool | verify_ (QEvt const *const e) noexcept |
Static Public Attributes | |
static QTimeEvt | timeEvtHead_ [QF_MAX_TICK_RATE] |
Static Public Attributes inherited from QP::QEvt | |
static constexpr std::uint8_t | MARKER {0xE0U} |
Private Member Functions | |
QTimeEvt () noexcept | |
QTimeEvt (QTimeEvt const &other)=delete | |
QTimeEvt & | operator= (QTimeEvt const &other)=delete |
Private Attributes | |
QTimeEvt *volatile | m_next |
void * | m_act |
QTimeEvtCtr volatile | m_ctr |
QTimeEvtCtr | m_interval |
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 |
std::uint8_t volatile | refCtr_ |
std::uint8_t | evtTag_ |
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 73 of file qf_time.cpp.
|
privatenoexcept |
Definition at line 439 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 96 of file qf_time.cpp.
|
noexcept |
Disarm a time event.
Definition at line 157 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 203 of file qf_time.cpp.
|
noexcept |
Check the "was disarmed" status of a time event.
Definition at line 265 of file qf_time.cpp.
|
inlinenoexcept |
Get the current value of the down-counter of a time event.
|
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 280 of file qf_time.cpp.
|
static |
Processes one clock tick for QUTest
Definition at line 274 of file qutest.cpp.
|
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 419 of file qf_time.cpp.
|
private |
|
private |
|
private |
|
private |
|
static |