40 #include "qf_port.hpp"
55 QTimeEvt QF::timeEvtHead_[QF_MAX_TICK_RATE];
79 void const *
const sender) noexcept
84 QTimeEvt *prev = &timeEvtHead_[tickRate];
103 if (timeEvtHead_[tickRate].m_act !=
nullptr) {
108 timeEvtHead_[tickRate].
m_act =
nullptr;
117 if (t->
m_ctr == 0U) {
131 if (t->
m_ctr == 0U) {
166 static_cast<void>(act->POST(t, sender));
208 if (timeEvtHead_[tickRate].m_next !=
nullptr) {
211 else if (timeEvtHead_[tickRate].m_act !=
nullptr) {
235 QEvt(
static_cast<QSignal>(sgnl), QEvt::STATIC_EVT),
246 && (tickRate < QF_MAX_TICK_RATE));
249 sig =
static_cast<QSignal>(sgnl);
271 QEvt(0U, QEvt::STATIC_EVT),
337 && (tickRate <
static_cast<std::uint8_t>(QF_MAX_TICK_RATE))
345 m_interval = interval;
468 && (tickRate <
static_cast<std::uint8_t>(QF_MAX_TICK_RATE))
544 return isDisarmed != 0U;
unsigned char uint8_t
exact-width 8-bit unsigned int
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
QActive active object (based on QP::QHsm implementation)
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
static bool noTimeEvtsActiveX(std::uint_fast8_t const tickRate) noexcept
Returns true if all time events are inactive and false any time event is active.
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
heads of linked lists of time events, one for every clock tick rate
static void tickX_(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Processes all armed time events at every clock tick.
QTimeEvt * toTimeEvt(void) noexcept
encapsulate the cast the m_act attribute to QTimeEvt*
QTimeEvtCtr currCtr(void) const noexcept
Get the current value of the down-counter of a time event.
QTimeEvtCtr volatile m_ctr
the internal down-counter of the time event.
QActive * toActive(void) noexcept
encapsulate the cast the m_act attribute to QActive*
QTimeEvtCtr m_interval
the interval for the periodic time event (zero for the one-shot time event).
QTimeEvt(void) noexcept
private default constructor only for friends
QTimeEvt *volatile m_next
link to the next time event in the list
void armX(QTimeEvtCtr const nTicks, QTimeEvtCtr const interval=0U) noexcept
Arm a time event (one shot or periodic) for event posting.
bool disarm(void) noexcept
Disarm a time event.
bool wasDisarmed(void) noexcept
Check the "was disarmed" status of a time event.
bool rearm(QTimeEvtCtr const nTicks) noexcept
Rearm a time event.
void *volatile m_act
the active object that receives the time events
namespace associated with the QP/C++ framework
@ QS_QF_TIMEEVT_AUTO_DISARM
a time event expired and was disarmed
@ QS_QF_TIMEEVT_DISARM
true disarming of an armed time event
@ QS_QF_TIMEEVT_REARM
rearming of a time event
@ QS_QF_TIMEEVT_POST
a time event posted itself directly to an AO
@ QS_QF_TIMEEVT_DISARM_ATTEMPT
attempt to disarm a disarmed QTimeEvt
@ QS_QF_TICK
QP::QF::tickX() was called.
@ QS_QF_TIMEEVT_ARM
a time event was armed
constexpr std::uint8_t TE_WAS_DISARMED
constexpr std::uint8_t TE_TICK_RATE
constexpr std::uint8_t TE_IS_LINKED
constexpr enum_t Q_USER_SIG
Offset or the user signals.
std::uint16_t QSignal
QSignal represents the signal of an event.
Customizable and memory-efficient assertions for embedded systems.
#define Q_DEFINE_THIS_MODULE(name_)
Define the user-specified module name for assertions in this file.
#define Q_REQUIRE_ID(id_, test_)
Assertion for checking preconditions with user-specified assertion-id.
int enum_t
alias for enumerations used for event signals
#define QF_CRIT_EXIT_NOP()
No-operation for exiting a critical section.
Internal (package scope) QF/C++ interface.
#define QF_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define Q_ASSERT_CRIT_(id_, test_)
#define QF_CRIT_X_()
This is an internal macro for exiting a critical section.
#define QF_CRIT_E_()
This is an internal macro for entering a critical section.
Dummy definitions of the QS macros that avoid code generation from the QS instrumentation.
#define QS_U8_PRE_(data_)
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_OBJ_PRE_(obj_)
#define QS_TEC_PRE_(ctr_)
#define QS_END_NOCRIT_PRE_()
#define QS_2U8_PRE_(data1_, data2_)
#define QS_SIG_PRE_(sig_)
Internal (package scope) QS/C++ interface.
QS/C++ port to a 32-bit CPU, generic compiler.
QSignal sig
signal of the event instance
std::uint8_t volatile refCtr_
reference counter