33#define QP_VERSION_STR "8.1.2"
34#define QP_VERSION 812U
36#define QP_RELEASE 0x6A45C1C3U
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;
319 std::uint_fast8_t
const qsId);
323 std::uint_fast8_t
const qsId);
327 std::int_fast8_t
const depth,
328 std::uint_fast8_t
const qsId);
342 void const *
const e,
343 std::uint_fast8_t
const qsId)
override;
345 QEvt const *
const e,
346 std::uint_fast8_t
const qsId)
override;
357 std::uint_fast8_t const qsId);
359 QMState const * const curr_state,
360 QMState const * const tran_source,
361 std::uint_fast8_t const qsId);
364 std::uint_fast8_t const qsId);
375#define Q_STATE_DECL(state_) \
376 QP::QState state_ ## _h(QP::QEvt const * const e); \
377 static QP::QState state_(void * const me, QP::QEvt const * const e)
379#define Q_STATE_DEF(subclass_, state_) \
380 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) { \
381 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
382 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
384#define Q_EVT_CAST(subclass_) (static_cast<subclass_ const *>(e))
385#define Q_STATE_CAST(handler_) (reinterpret_cast<QP::QStateHandler>(handler_))
387#define QM_STATE_DECL(state_) \
388 QP::QState state_ ## _h(QP::QEvt const * const e); \
389 static QP::QState state_(void * const me, QP::QEvt const * const e); \
390 static QP::QMState const state_ ## _s
392#define QM_ACTION_DECL(action_) \
393 QP::QState action_ ## _h(); \
394 static QP::QState action_(void * const me)
396#define QM_STATE_DEF(subclass_, state_) \
397 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) {\
398 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
399 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
401#define QM_ACTION_DEF(subclass_, action_) \
402 QP::QState subclass_::action_(void * const me) { \
403 return static_cast<subclass_ *>(me)->action_ ## _h(); } \
404 QP::QState subclass_::action_ ## _h()
407 #define INIT(qsId_) init((qsId_))
408 #define DISPATCH(e_, qsId_) dispatch((e_), (qsId_))
410 #define INIT(dummy) init(0U)
411 #define DISPATCH(e_, dummy) dispatch((e_), 0U)
422#if (QF_TIMEEVT_CTR_SIZE == 1U)
424#elif (QF_TIMEEVT_CTR_SIZE == 2U)
426#elif (QF_TIMEEVT_CTR_SIZE == 4U)
430#if (QF_MAX_ACTIVE <= 8U)
432#elif (8U < QF_MAX_ACTIVE) && (QF_MAX_ACTIVE <= 16U)
434#elif (16 < QF_MAX_ACTIVE)
446#if (QF_MAX_ACTIVE > 32U)
454 bool hasElement(std::uint_fast8_t const n) const noexcept;
455 void insert(std::uint_fast8_t const n) noexcept;
456 void remove(std::uint_fast8_t const n) noexcept;
457 std::uint_fast8_t
findMax() const noexcept;
493#ifdef QACTIVE_THREAD_TYPE
497#ifdef QACTIVE_OS_OBJ_TYPE
501#ifdef QACTIVE_EQUEUE_TYPE
511 void const *
const e,
512 std::uint_fast8_t
const qsId)
override;
514 QEvt const *
const e,
515 std::uint_fast8_t
const qsId)
override;
522 void const * attr2 =
nullptr);
524 QEvtPtr * const qSto, std::uint_fast16_t const qLen,
525 void * const stkSto, std::uint_fast16_t const stkSize,
526 void const * const par =
nullptr);
528#ifdef QACTIVE_CAN_STOP
534 void const * const sender) noexcept
539 bool postx_(
QEvt const *
const e,
540 std::uint_fast16_t
const margin,
541 void const *
const sender)
noexcept;
542 void postLIFO(
QEvt const *
const e)
noexcept;
543 QEvt const * get_() noexcept;
544 static std::uint16_t getQueueUse(
545 std::uint_fast8_t const prio) noexcept;
546 static std::uint16_t getQueueFree(
547 std::uint_fast8_t const prio) noexcept;
548 static std::uint16_t getQueueMin(
549 std::uint_fast8_t const prio) noexcept;
552 QSignal const maxSignal) noexcept;
553 static
void publish_(
554 QEvt const * const e,
555 void const * const sender,
556 std::uint_fast8_t const qsId) noexcept;
557 void subscribe(
QSignal const sig) const noexcept;
558 void unsubscribe(
QSignal const sig) const noexcept;
559 void unsubscribeAll() const noexcept;
562 QEvt const * const e) const noexcept;
563 bool recall(
QEQueue * const eq) noexcept;
564 std::uint16_t flushDeferred(
566 std::uint_fast16_t const num = 0xFFFFU) const noexcept;
573#ifdef QACTIVE_THREAD_TYPE
586#ifdef QACTIVE_OS_OBJ_TYPE
598 QEvt const *
const e,
599 std::uint_fast16_t
const margin,
601 void const *
const sender)
noexcept;
606 void const * sender)
noexcept;
611 QEvt const *
const e,
612 void const *
const sender);
614 QPSet *
const subscrSet,
615 QEvt const *
const e,
616 void const *
const sender);
646 void const *
const e,
647 std::uint_fast8_t
const qsId)
override;
649 QEvt const *
const e,
650 std::uint_fast8_t
const qsId)
override;
658#if (QF_MAX_TICK_RATE > 0U)
673 std::uint_fast8_t
const tickRate = 0U)
noexcept;
675 std::uint32_t
const nTicks,
676 std::uint32_t
const interval = 0U)
noexcept;
678 bool rearm(std::uint32_t const nTicks) noexcept;
697 std::uint_fast8_t
const tickRate,
698 void const *
const sender)
noexcept;
702 std::uint_fast8_t
const tickRate,
703 void const *
const sender);
708 std::uint_fast8_t
const tickRate,
710 void const * sender)
noexcept;
712 static bool noActive(std::uint_fast8_t
const tickRate)
noexcept;
728 std::uint_fast8_t const tickRate) noexcept;
738 explicit QTicker(std::uint8_t
const tickRate)
noexcept;
741 void const *
const e,
742 std::uint_fast8_t
const qsId)
override;
744 QEvt const *
const e,
745 std::uint_fast8_t
const qsId)
override;
746 void trig_(
void const *
const sender)
noexcept;
756 QSignal const maxSignal)
noexcept
764 void const *
const sender, std::uint_fast8_t
const qsId)
noexcept
772 std::uint_fast8_t
const prio)
noexcept
778#if (QF_MAX_TICK_RATE > 0U)
781 std::uint_fast8_t
const tickRate,
782 void const *
const sender)
noexcept
792 void *
const poolSto,
793 std::uint_fast32_t
const poolSize,
794 std::uint_fast16_t
const evtSize)
noexcept;
796std::uint16_t poolGetMaxBlockSize() noexcept;
797std::uint16_t
getPoolUse(std::uint_fast8_t const poolNum) noexcept;
798std::uint16_t
getPoolFree(std::uint_fast8_t const poolNum) noexcept;
799std::uint16_t
getPoolMin(std::uint_fast8_t const poolNum) noexcept;
801 std::uint_fast16_t const evtSize,
802 std::uint_fast16_t const margin,
804void gc(
QEvt const * const e) noexcept;
806 QEvt const * const e,
807 QEvt const * const evtRef) noexcept;
812 template<
class evtT_>
816 return static_cast<evtT_*
>(
819 template<
class evtT_>
820 inline evtT_ * q_new_x(std::uint_fast16_t
const margin,
825 return static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
828 template<
class evtT_,
typename... Args>
832 evtT_ *e =
static_cast<evtT_*
>(
837 template<
class evtT_,
typename... Args>
838 inline evtT_ *
q_new_x(std::uint_fast16_t
const margin,
839 QSignal const sig, Args... args)
844 static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
856 evtT_
const *& evtRef)
870 std::uint_fast16_t
const evtSize,
871 std::uint_fast16_t
const margin,
883#ifdef QF_ON_CONTEXT_SW
894#define Q_PRIO(prio_, pthre_) \
895 (static_cast<QP::QPrioSpec>((prio_) | (pthre_) << 8U))
898 #define Q_NEW(evtT_, sig_) (QP::QF::q_new<evtT_>((sig_)))
899 #define Q_NEW_X(evtT_, margin_, sig_) \
900 (QP::QF::q_new_x<evtT_>((margin_), (sig_)))
902 #define Q_NEW(evtT_, sig_, ...) \
903 (QP::QF::q_new<evtT_>((sig_), __VA_ARGS__))
904 #define Q_NEW_X(evtT_, margin_, sig_, ...) \
905 (QP::QF::q_new_x<evtT_>((margin_), (sig_), __VA_ARGS__))
908#define Q_NEW_REF(evtRef_, evtT_) (QP::QF::q_new_ref<evtT_>(e, (evtRef_)))
909#define Q_DELETE_REF(evtRef_) do { \
910 QP::QF::deleteRef_((evtRef_)); \
911 (evtRef_) = nullptr; \
915 #define PUBLISH(e_, sender_) \
916 publish_((e_), (sender_), (sender_)->getPrio())
917 #define POST(e_, sender_) post_((e_), (sender_))
918 #define POST_X(e_, margin_, sender_) \
919 postx_((e_), (margin_), (sender_))
920 #define TICK_X(tickRate_, sender_) tick((tickRate_), (sender_))
921 #define TRIG(sender_) trig_((sender_))
923 #define PUBLISH(e_, dummy) publish_((e_), nullptr, 0U)
924 #define POST(e_, dummy) post_((e_), nullptr)
925 #define POST_X(e_, margin_, dummy) postx_((e_), (margin_), nullptr)
926 #define TICK_X(tickRate_, dummy) tick((tickRate_), nullptr)
927 #define TRIG(sender_) trig_(nullptr)
930#define TICK(sender_) TICK_X(0U, (sender_))
932#ifndef QF_CRIT_EXIT_NOP
933 #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
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()
virtual ~QAsm() noexcept
Virtual destructor of the QP::QAsm abstract base class.
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).
std::int_fast8_t tran_complex_(QStateHandler *const path, std::uint_fast8_t const qsId)
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
std::int_fast8_t tran_simple_(QStateHandler *const path, 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.
QHsm(QStateHandler const initial) noexcept
void enter_target_(QStateHandler *const path, std::int_fast8_t const depth, std::uint_fast8_t const qsId)
bool isIn(QStateHandler const stateHndl) noexcept override
Check whether the HSM is in a given state.
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
static 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.
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.
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 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