33#define QP_VERSION_STR "8.1.2"
34#define QP_VERSION 812U
36#define QP_RELEASE 0x64F71D43U
43#define QF_MAX_ACTIVE 32U
46#if (QF_MAX_ACTIVE > 64U)
47#error QF_MAX_ACTIVE exceeds the maximum of 64U;
50#ifndef QF_MAX_TICK_RATE
51#define QF_MAX_TICK_RATE 1U
54#if (QF_MAX_TICK_RATE > 15U)
55#error QF_MAX_TICK_RATE exceeds the maximum of 15U;
59#define QF_MAX_EPOOL 3U
62#if (QF_MAX_EPOOL > 15U)
63#error QF_MAX_EPOOL exceeds the maximum of 15U;
66#ifndef QF_TIMEEVT_CTR_SIZE
67#define QF_TIMEEVT_CTR_SIZE 4U
70#if (QF_TIMEEVT_CTR_SIZE > 4U)
71#error QF_TIMEEVT_CTR_SIZE defined incorrectly, expected 1U, 2U, or 4U;
74#ifndef QF_EVENT_SIZ_SIZE
75#define QF_EVENT_SIZ_SIZE 2U
78#if (QF_EVENT_SIZ_SIZE > 4U)
79#error QF_EVENT_SIZ_SIZE defined incorrectly, expected 1U, 2U, or 4U;
89#define Q_UNUSED_PAR(par_) (static_cast<void>(par_))
90#define Q_DIM(array_) (sizeof(array_) / sizeof((array_)[0U]))
91#define Q_UINT2PTR_CAST(type_, uint_) (reinterpret_cast<type_ *>(uint_))
214 void const *
const e,
215 std::uint_fast8_t
const qsId) = 0;
216 virtual void init(std::uint_fast8_t
const qsId);
218 QEvt const *
const e,
219 std::uint_fast8_t
const qsId) = 0;
230 static QState top(
void *
const me,
QEvt const *
const e)
noexcept;
233 explicit QAsm() noexcept;
262 void const *
const tatbl)
noexcept
278 static_cast<void>(s);
292 static_cast<void>(s);
306 void const *
const e,
307 std::uint_fast8_t
const qsId)
override;
309 QEvt const *
const e,
310 std::uint_fast8_t
const qsId)
override;
322 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
323 std::uint_fast8_t
const qsId);
326 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
327 std::uint_fast8_t
const qsId);
330 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
331 std::size_t
const depth,
332 std::uint_fast8_t
const qsId);
346 void const *
const e,
347 std::uint_fast8_t
const qsId)
override;
349 QEvt const *
const e,
350 std::uint_fast8_t
const qsId)
override;
361 std::uint_fast8_t const qsId);
363 QMState const * const curr_state,
364 QMState const * const tran_source,
365 std::uint_fast8_t const qsId);
368 std::uint_fast8_t const qsId);
379#define Q_STATE_DECL(state_) \
380 QP::QState state_ ## _h(QP::QEvt const * const e); \
381 static QP::QState state_(void * const me, QP::QEvt const * const e)
383#define Q_STATE_DEF(subclass_, state_) \
384 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) { \
385 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
386 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
388#define Q_EVT_CAST(subclass_) (static_cast<subclass_ const *>(e))
389#define Q_STATE_CAST(handler_) (reinterpret_cast<QP::QStateHandler>(handler_))
391#define QM_STATE_DECL(state_) \
392 QP::QState state_ ## _h(QP::QEvt const * const e); \
393 static QP::QState state_(void * const me, QP::QEvt const * const e); \
394 static QP::QMState const state_ ## _s
396#define QM_ACTION_DECL(action_) \
397 QP::QState action_ ## _h(); \
398 static QP::QState action_(void * const me)
400#define QM_STATE_DEF(subclass_, state_) \
401 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) {\
402 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
403 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
405#define QM_ACTION_DEF(subclass_, action_) \
406 QP::QState subclass_::action_(void * const me) { \
407 return static_cast<subclass_ *>(me)->action_ ## _h(); } \
408 QP::QState subclass_::action_ ## _h()
411 #define INIT(qsId_) init((qsId_))
412 #define DISPATCH(e_, qsId_) dispatch((e_), (qsId_))
414 #define INIT(dummy) init(0U)
415 #define DISPATCH(e_, dummy) dispatch((e_), 0U)
426#if (QF_TIMEEVT_CTR_SIZE == 1U)
428#elif (QF_TIMEEVT_CTR_SIZE == 2U)
430#elif (QF_TIMEEVT_CTR_SIZE == 4U)
434#if (QF_MAX_ACTIVE <= 8U)
436#elif (8U < QF_MAX_ACTIVE) && (QF_MAX_ACTIVE <= 16U)
438#elif (16 < QF_MAX_ACTIVE)
450#if (QF_MAX_ACTIVE > 32U)
465 bool hasElement(std::uint_fast8_t const n) const noexcept;
466 void insert(std::uint_fast8_t const n) noexcept;
467 void remove(std::uint_fast8_t const n) noexcept;
468 std::uint_fast8_t
findMax() const noexcept;
504#ifdef QACTIVE_THREAD_TYPE
508#ifdef QACTIVE_OS_OBJ_TYPE
512#ifdef QACTIVE_EQUEUE_TYPE
522 void const *
const e,
523 std::uint_fast8_t
const qsId)
override;
525 QEvt const *
const e,
526 std::uint_fast8_t
const qsId)
override;
533 void const * attr2 =
nullptr);
535 QEvtPtr * const qSto, std::uint_fast16_t const qLen,
536 void * const stkSto, std::uint_fast16_t const stkSize,
537 void const * const par =
nullptr);
539#ifdef QACTIVE_CAN_STOP
545 void const * const sender) noexcept
550 bool postx_(
QEvt const *
const e,
551 std::uint_fast16_t
const margin,
552 void const *
const sender)
noexcept;
553 void postLIFO(
QEvt const *
const e)
noexcept;
554 QEvt const * get_() noexcept;
555 static std::uint16_t getQueueUse(
556 std::uint_fast8_t const prio) noexcept;
557 static std::uint16_t getQueueFree(
558 std::uint_fast8_t const prio) noexcept;
559 static std::uint16_t getQueueMin(
560 std::uint_fast8_t const prio) noexcept;
563 QSignal const maxSignal) noexcept;
564 static
void publish_(
565 QEvt const * const e,
566 void const * const sender,
567 std::uint_fast8_t const qsId) noexcept;
568 void subscribe(
QSignal const sig) const noexcept;
569 void unsubscribe(
QSignal const sig) const noexcept;
570 void unsubscribeAll() const noexcept;
573 QEvt const * const e) const noexcept;
574 bool recall(
QEQueue * const eq) noexcept;
575 std::uint16_t flushDeferred(
577 std::uint_fast16_t const num = 0xFFFFU) const noexcept;
584#ifdef QACTIVE_THREAD_TYPE
597#ifdef QACTIVE_OS_OBJ_TYPE
609 QEvt const *
const e,
610 std::uint_fast16_t
const margin,
612 void const *
const sender)
noexcept;
617 void const * sender)
noexcept;
622 QEvt const *
const e,
623 void const *
const sender);
625 QPSet *
const subscrSet,
626 QEvt const *
const e,
627 void const *
const sender);
657 void const *
const e,
658 std::uint_fast8_t
const qsId)
override;
660 QEvt const *
const e,
661 std::uint_fast8_t
const qsId)
override;
669#if (QF_MAX_TICK_RATE > 0U)
684 std::uint_fast8_t
const tickRate = 0U)
noexcept;
686 std::uint32_t
const nTicks,
687 std::uint32_t
const interval = 0U)
noexcept;
689 bool rearm(std::uint32_t const nTicks) noexcept;
708 std::uint_fast8_t
const tickRate,
709 void const *
const sender)
noexcept;
713 std::uint_fast8_t
const tickRate,
714 void const *
const sender);
719 std::uint_fast8_t
const tickRate,
721 void const * sender)
noexcept;
723 static bool noActive(std::uint_fast8_t
const tickRate)
noexcept;
739 std::uint_fast8_t const tickRate) noexcept;
749 explicit QTicker(std::uint8_t
const tickRate)
noexcept;
752 void const *
const e,
753 std::uint_fast8_t
const qsId)
override;
755 QEvt const *
const e,
756 std::uint_fast8_t
const qsId)
override;
757 void trig_(
void const *
const sender)
noexcept;
767 QSignal const maxSignal)
noexcept
775 void const *
const sender, std::uint_fast8_t
const qsId)
noexcept
783 std::uint_fast8_t
const prio)
noexcept
789#if (QF_MAX_TICK_RATE > 0U)
792 std::uint_fast8_t
const tickRate,
793 void const *
const sender)
noexcept
803 void *
const poolSto,
804 std::uint_fast32_t
const poolSize,
805 std::uint_fast16_t
const evtSize)
noexcept;
807std::uint16_t poolGetMaxBlockSize() noexcept;
808std::uint16_t
getPoolUse(std::uint_fast8_t const poolNum) noexcept;
809std::uint16_t
getPoolFree(std::uint_fast8_t const poolNum) noexcept;
810std::uint16_t
getPoolMin(std::uint_fast8_t const poolNum) noexcept;
812 std::uint_fast16_t const evtSize,
813 std::uint_fast16_t const margin,
815void gc(
QEvt const * const e) noexcept;
817 QEvt const * const e,
818 QEvt const * const evtRef) noexcept;
823 template<
class evtT_>
827 return static_cast<evtT_*
>(
830 template<
class evtT_>
831 inline evtT_ * q_new_x(std::uint_fast16_t
const margin,
836 return static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
839 template<
class evtT_,
typename... Args>
843 evtT_ *e =
static_cast<evtT_*
>(
848 template<
class evtT_,
typename... Args>
849 inline evtT_ *
q_new_x(std::uint_fast16_t
const margin,
850 QSignal const sig, Args... args)
855 static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
867 evtT_
const *& evtRef)
881 std::uint_fast16_t
const evtSize,
882 std::uint_fast16_t
const margin,
894#ifdef QF_ON_CONTEXT_SW
905#define Q_PRIO(prio_, pthre_) \
906 (static_cast<QP::QPrioSpec>((prio_) | (pthre_) << 8U))
909 #define Q_NEW(evtT_, sig_) (QP::QF::q_new<evtT_>((sig_)))
910 #define Q_NEW_X(evtT_, margin_, sig_) \
911 (QP::QF::q_new_x<evtT_>((margin_), (sig_)))
913 #define Q_NEW(evtT_, sig_, ...) \
914 (QP::QF::q_new<evtT_>((sig_), __VA_ARGS__))
915 #define Q_NEW_X(evtT_, margin_, sig_, ...) \
916 (QP::QF::q_new_x<evtT_>((margin_), (sig_), __VA_ARGS__))
919#define Q_NEW_REF(evtRef_, evtT_) (QP::QF::q_new_ref<evtT_>(e, (evtRef_)))
920#define Q_DELETE_REF(evtRef_) do { \
921 QP::QF::deleteRef_((evtRef_)); \
922 (evtRef_) = nullptr; \
926 #define PUBLISH(e_, sender_) \
927 publish_((e_), (sender_), (sender_)->getPrio())
928 #define POST(e_, sender_) post_((e_), (sender_))
929 #define POST_X(e_, margin_, sender_) \
930 postx_((e_), (margin_), (sender_))
931 #define TICK_X(tickRate_, sender_) tick((tickRate_), (sender_))
932 #define TRIG(sender_) trig_((sender_))
934 #define PUBLISH(e_, dummy) publish_((e_), nullptr, 0U)
935 #define POST(e_, dummy) post_((e_), nullptr)
936 #define POST_X(e_, margin_, dummy) postx_((e_), (margin_), nullptr)
937 #define TICK_X(tickRate_, dummy) tick((tickRate_), nullptr)
938 #define TRIG(sender_) trig_(nullptr)
941#define TICK(sender_) TICK_X(0U, (sender_))
943#ifndef QF_CRIT_EXIT_NOP
944 #define QF_CRIT_EXIT_NOP() (static_cast<void>(0))
Active object class (based on the QP::QHsm implementation strategy).
friend class QActiveDummy
virtual bool postFromISR(QEvt const *const e, std::uint_fast16_t const margin, void *par, void const *const sender) noexcept
The "FromISR" variant used in the QP port to "FreeRTOS".
QACTIVE_THREAD_TYPE m_thread
Port-dependent representation of the thread of the active object.
static std::uint16_t getQueueMin(std::uint_fast8_t const prio) noexcept
void unregister_() noexcept
Un-register the active object from the framework.
QACTIVE_OS_OBJ_TYPE const & getOsObject() const &
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
static void multicast_(QPSet *const subscrSet, QEvt const *const e, void const *const sender)
void post_(QEvt const *const e, void const *const sender) noexcept
Posts an event e directly to the event queue of the active object using the First-In-First-Out (FIFO)...
void register_() noexcept
Register this active object to be managed by the framework.
void postFIFO_(QEvt const *const e, void const *const sender)
static void publishFromISR(QEvt const *e, void *par, void const *sender) noexcept
The "FromISR" variant used in the QP port to "FreeRTOS".
static void publish_(QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
Publish event to all subscribers of a given signal e->sig.
void stop()
Stops execution of an active object and removes it from the framework's supervision.
static void evtLoop_(QActive *act)
Event loop thread routine for executing an active object act (defined some in QP ports).
void setAttr(std::uint32_t attr1, void const *attr2=nullptr)
Generic setting of additional attributes (defined in some QP ports).
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
bool isIn(QStateHandler const stateHndl) noexcept override
Virtual function to check whether the state machine is in a given state.
bool postx_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
Posts an event e directly to the event queue of the active object using the First-In-First-Out (FIFO)...
static QActive * fromRegistry(std::uint_fast8_t const prio)
QActive(QStateHandler const initial) noexcept
QActive constructor (abstract base class).
std::uint8_t getPrio() const noexcept
QACTIVE_EQUEUE_TYPE m_eQueue
Port-dependent event-queue type (often QP::QEQueue).
QACTIVE_THREAD_TYPE const & getThread() const &&=delete
QStateHandler childState(QStateHandler const parentHandler) noexcept
static void psInit(QSubscrList *const subscrSto, QSignal const maxSignal) noexcept
Publish event to all subscribers of a given signal e->sig.
void start(QPrioSpec const prioSpec, QEvtPtr *const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par=nullptr)
Starts execution of an active object and registers the object with the framework.
QACTIVE_OS_OBJ_TYPE const & getOsObject() const &&=delete
void setThread(QACTIVE_THREAD_TYPE const &thr) noexcept
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
std::uint8_t m_pthre
Preemption-threshold [1..QF_MAX_ACTIVE] of this AO.
QACTIVE_OS_OBJ_TYPE m_osObject
Port-dependent per-thread object.
std::uint8_t m_prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
QACTIVE_THREAD_TYPE const & getThread() const &
Abstract State Machine class (state machine interface).
QState qm_entry(QMState const *const s) noexcept
Internal helper function to execute state entry actions in QP::QMsm.
QAsm() noexcept
Constructor of the QP::QAsm base class.
QState qm_tran_hist(QMState const *const hist, void const *const tatbl) noexcept
Internal helper function to take a state transition to history in QP::QMsm.
QStateHandler state() const noexcept
static constexpr QState Q_RET_UNHANDLED
QState qm_tran(void const *const tatbl) noexcept
Internal helper function to take a state transition in QP::QMsm.
static constexpr QState Q_RET_TRAN
static constexpr QState QM_SUPER()
static constexpr QState Q_RET_ENTRY
QState qm_exit(QMState const *const s) noexcept
Internal helper function to execute state exit actions in QP::QMsm.
QState tran_hist(QStateHandler const hist) noexcept
Internal helper function to take a state transition to history in sublclasses of QP::QAsm.
QState super(QStateHandler const superstate) noexcept
Internal helper function to indicate superstate of a given state in sublclasses of QP::QAsm.
QState qm_tran_init(void const *const tatbl) noexcept
QAsmAttr m_temp
Temporary storage for target/act-table etc.
static constexpr QState Q_RET_IGNORED
virtual bool isIn(QStateHandler const stateHndl)=0
Virtual function to check whether the state machine is in a given state.
static constexpr QState Q_RET_SUPER
static constexpr QState Q_UNHANDLED()
virtual QStateHandler getStateHandler() const noexcept=0
Virtual method for getting the current state handler.
static constexpr QState Q_RET_TRAN_INIT
static constexpr QState Q_RET_TRAN_HIST
static constexpr QState Q_RET_EXIT
QMState const * stateObj() const noexcept
virtual ~QAsm()=default
Virtual destructor of the QP::QAsm abstract base class.
static constexpr QState Q_HANDLED()
virtual void init(void const *const e, std::uint_fast8_t const qsId)=0
Virtual function to take the top-most initial transition in the state machine.
QState tran(QStateHandler const target) noexcept
Internal helper function to take a state transition in sublclasses of QP::QAsm.
static constexpr QState QM_UNHANDLED()
static constexpr QSignal Q_INIT_SIG
static constexpr QActionHandler const Q_ACTION_NULL
QAsmAttr m_state
Current state (pointer to the current state-handler function).
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qsId)=0
Virtual function to dispatch an event to the state machine.
static constexpr QSignal Q_ENTRY_SIG
static constexpr QSignal Q_EXIT_SIG
static constexpr QSignal Q_EMPTY_SIG
static constexpr QState Q_RET_HANDLED
static constexpr QMState const * QM_STATE_NULL
static QState top(void *const me, QEvt const *const e) noexcept
Top state handler that ignores all events.
static constexpr QState QM_HANDLED()
void init(DynEvt const dummy) const noexcept
Event initialization for dynamic events (overload).
@ DYNAMIC
Dummy parameter for dynamic event initialization (see QEvt::QEvt(DynEvt)).
void init() const noexcept
Event initialization for dynamic events.
std::uint32_t poolNum_
Event pool number of this event.
constexpr QEvt(QSignal const s) noexcept
Event constexpr constructor applicable to immutable and mutable event instances.
std::uint32_t refCtr_
Event reference counter.
QEvt()=delete
Disallowed default event constructor.
std::uint32_t filler_
Member of QP::QEvt to make it identical size in QP/C++ and SafeQP/C++.
std::uint32_t sig
Signal of the event (see Event Signal).
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
static constexpr std::size_t MAX_NEST_DEPTH_
void enter_target_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::size_t const depth, std::uint_fast8_t const qsId)
QStateHandler childState(QStateHandler const parentHndl) noexcept
Obtain the current active child state of a given parent in QP::QMsm.
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
std::size_t tran_simple_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::uint_fast8_t const qsId)
QHsm(QStateHandler const initial) noexcept
bool isIn(QStateHandler const stateHndl) noexcept override
Check whether the HSM is in a given state.
std::size_t tran_complex_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::uint_fast8_t const qsId)
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
QMActive(QStateHandler const initial) noexcept
Constructor of QP::QMActive class.
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
bool isIn(QStateHandler const stateHndl) noexcept override
Virtual function to check whether the state machine is in a given state.
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
QMState const * childStateObj(QMState const *const parent) const noexcept
QMState const * childStateObj(QMState const *const parentHndl) const noexcept
Obtain the current active child state of a given parent in QP::QMsm.
void exitToTranSource_(QMState const *const curr_state, QMState const *const tran_source, std::uint_fast8_t const qsId)
Exit the current state up to the explicit transition source.
QState execTatbl_(QMTranActTable const *const tatbl, std::uint_fast8_t const qsId)
Execute transition-action table.
static QMState const * topQMState() noexcept
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
QState enterHistory_(QMState const *const hist, std::uint_fast8_t const qsId)
Enter history of a composite state.
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
bool isIn(QStateHandler const stateHndl) noexcept override
Tests if a given state is part of the current active state configuration.
QMsm(QStateHandler const initial) noexcept
Constructor of QP::QMsm.
QStateHandler getStateHandler() const noexcept override
Obtain the current active state from a MSM (read only).
Set of Active Objects of up to QF_MAX_ACTIVE elements.
std::uint_fast8_t findMax() const noexcept
Find the maximum element in the set.
void remove(std::uint_fast8_t const n) noexcept
Remove element n from the priority-set (n = 1..QF_MAX_ACTIVE).
QPSetBits m_bits1
Bitmask for elements 33..64.
bool notEmpty() const noexcept
Find out whether the priority-set is NOT empty.
bool hasElement(std::uint_fast8_t const n) const noexcept
Find out whether the priority-set has element n.
QPSetBits m_bits0
Bitmask for elements 1..32.
void setEmpty() noexcept
Make the priority set empty.
bool isEmpty() const noexcept
Find out whether the priority-set is empty.
void insert(std::uint_fast8_t const n) noexcept
Insert element n into the priority-set (n = 1..QF_MAX_ACTIVE).
Subscriber List (for publish-subscribe).
QPSet m_set
The set of AOs that subscribed to a given event signal.
void trig_(void const *const sender) noexcept
Asynchronously trigger the QTicker active object to perform tick processing.
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
QTicker(std::uint8_t const tickRate) noexcept
Constructor of the QTicker Active Object class.
void const * getAct() const &&=delete
static void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Processes all armed time events at every clock tick.
QTimeEvt * m_next
Link to the next time event in the list.
QTimeEvt * toTimeEvt() noexcept
bool disarm() noexcept
Disarm a time event.
QTimeEvt(QActive *const act, QSignal const sig, std::uint_fast8_t const tickRate=0U) noexcept
The "extended" constructor to initialize a Time Event.
QTimeEvtCtr getInterval() const noexcept
static bool noActive(std::uint_fast8_t const tickRate) noexcept
Check if any time events are active at a given clock tick rate.
static void tickFromISR(std::uint_fast8_t const tickRate, void *par, void const *sender) noexcept
void * m_act
Active object that receives the time events.
QActive * toActive() noexcept
void armX(std::uint32_t const nTicks, std::uint32_t const interval=0U) noexcept
Arm a time event (extended version for one shot or periodic time event).
QTimeEvtCtr getCtr() const noexcept
Get the current value of the down-counter of a time event.
bool rearm(std::uint32_t const nTicks) noexcept
Rearm a time event.
std::uint8_t getTickRate() const noexcept
QTimeEvtCtr m_ctr
Down-counter of the time event.
QTimeEvtCtr m_interval
Interval for periodic time event (zero for one-shot time event).
void const * getAct() const &
bool wasDisarmed() noexcept
Check the "was disarmed" status of a time event.
eXtended (blocking) thread of the QXK preemptive kernel
QF Active Object Framework namespace.
void deleteRef_(QEvt const *const evtRef) noexcept
void onCleanup()
Cleanup QF callback.
QEvt const * newRef_(QEvt const *const e, QEvt const *const evtRef) noexcept
QEvt * newXfromISR_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, QSignal const sig) noexcept
void gc(QEvt const *const e) noexcept
Recycle a mutable (mutable) event.
QEvt * newX_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, QSignal const sig) noexcept
evtT_ * q_new_x(std::uint_fast16_t const margin, QSignal const sig, Args... args)
void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
evtT_ * q_new(QSignal const sig, Args... args)
void psInit(QSubscrList *const subscrSto, QSignal const maxSignal) noexcept
void gcFromISR(QEvt const *e) noexcept
std::uint16_t getPoolUse(std::uint_fast8_t const poolNum) noexcept
constexpr std::uint_fast16_t NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
void init()
QF initialization.
void q_new_ref(QP::QEvt const *const e, evtT_ const *&evtRef)
Create a new reference of the current event e.
std::uint16_t getPoolMin(std::uint_fast8_t const poolNum) noexcept
Obtain the minimum of free entries of the given event pool.
std::uint_fast16_t getQueueMin(std::uint_fast8_t const prio) noexcept
This function returns the minimum of free entries of the given event queue.
void q_delete_ref(evtT_ const *&evtRef)
Delete a new reference of the current event e.
int_t run()
Transfers control to QF to run the application.
void stop()
Invoked by the application layer to stop the QF framework and return control to the OS/Kernel (used i...
std::uint16_t getPoolFree(std::uint_fast8_t const poolNum) noexcept
void publish_(QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
void onStartup()
Startup QF callback.
QP/C++ Framework namespace.
constexpr QSignal Q_USER_SIG
std::uint32_t QTimeEvtCtr
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE.
QState(*)(void *const me) QActionHandler
Pointer to an action-handler function.
char const * version() noexcept
QEvt const * QEvtPtr
Pointer to const event instances passed around in QP/C++ Framework.
std::uint_fast8_t QState
Type returned from state-handler functions.
QState(*)(void *const me, QEvt const *const e) QStateHandler
Pointer to a state-handler function.
std::uint32_t QPSetBits
Bitmask for the internal representation of QPSet elements.
std::uint16_t QSignal
The signal of event QP::QEvt.
void(*)(QXThread *const me) QXThreadHandler
Pointer to an extended-thread handler function.
std::uint16_t QPrioSpec
Priority specification for Active Objects in QP.
int int_t
Alias for assertion-ID numbers in QP assertions and return from QP::QF::run().
#define Q_UNUSED_PAR(par_)
Helper macro to mark unused parameters of functions.
void QF_onContextSw(QP::QActive *prev, QP::QActive *next)
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
#define QACTIVE_OS_OBJ_TYPE
Port-specific QActive "OS-object" type.
#define QACTIVE_EQUEUE_TYPE
Port-specific QActive event queue type.
#define QACTIVE_THREAD_TYPE
Port-specific QActive thread type.
#define QF_LOG2(bitmask_)
Port-specific integer log-base-2 of a 32-bit bitmask.
State object for the QP::QMsm class (QM State Machine).
QActionHandler const entryAction
QStateHandler const stateHandler
QActionHandler const exitAction
QMState const * superstate
QActionHandler const initAction
Transition-Action Table for the QP::QMsm State Machine.
QActionHandler const act[1]
Attribute of for the QP::QAsm class (Abstract State Machine).
QMTranActTable const * tatbl