|
| QXThread (QXThreadHandler const handler, std::uint_fast8_t const tickRate=0U) noexcept |
| public constructor More...
|
|
bool | delayCancel () noexcept |
| cancel the delay More...
|
|
void | init (void const *const e, std::uint_fast8_t const qs_id) override |
| Overrides QHsm::init() More...
|
|
void | init (std::uint_fast8_t const qs_id) override |
| Overrides QHsm::init() More...
|
|
void | dispatch (QEvt const *const e, std::uint_fast8_t const qs_id) override |
| Overrides QHsm::dispatch() More...
|
|
void | start (std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par) override |
| Starts execution of an extended thread and registers the thread with the framework. More...
|
|
void | start (std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize) override |
| Overloaded start function (no initialization event) More...
|
|
bool | post_ (QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept override |
| Posts an event e directly to the event queue of the extended thread using the First-In-First-Out (FIFO) policy. More...
|
|
void | postLIFO (QEvt const *const e) noexcept override |
| Posts an event directly to the event queue of the extended thread using the Last-In-First-Out (LIFO) policy. More...
|
|
virtual void | start (std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par) |
| Starts execution of an active object and registers the object with the framework. More...
|
|
virtual void | start (std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize) |
| Overloaded start function (no initialization parameter) More...
|
|
void | stop () |
| Stops execution of an active object and removes it from the framework's supervision. More...
|
|
virtual bool | post_ (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) policy. More...
|
|
virtual void | postLIFO (QEvt const *const e) noexcept |
| Posts an event e directly to the event queue of the active object using the Last-In-First-Out (LIFO) policy. More...
|
|
QEvt const * | get_ () noexcept |
| Get an event from the event queue of an active object. More...
|
|
void | subscribe (enum_t const sig) const noexcept |
| Subscribes for delivery of signal sig to the active object. More...
|
|
void | unsubscribe (enum_t const sig) const noexcept |
| Unsubscribes from the delivery of signal sig to the active object. More...
|
|
void | unsubscribeAll () const noexcept |
| Unsubscribes from the delivery of all signals to the active object. More...
|
|
bool | defer (QEQueue *const eq, QEvt const *const e) const noexcept |
| Defer an event to a given separate event queue. More...
|
|
bool | recall (QEQueue *const eq) noexcept |
| Recall a deferred event from a given event queue. More...
|
|
std::uint_fast16_t | flushDeferred (QEQueue *const eq) const noexcept |
| Flush the specified deferred queue 'eq'. More...
|
|
std::uint_fast8_t | getPrio () const noexcept |
| Get the priority of the active object. More...
|
|
void | setPrio (std::uint_fast8_t const prio) noexcept |
| Set the priority of the active object. More...
|
|
void | setAttr (std::uint32_t attr1, void const *attr2=nullptr) |
| Generic setting of additional attributes (useful in QP ports) More...
|
|
void | register_ () noexcept |
| Register this active object to be managed by the framework. More...
|
|
void | unregister_ () noexcept |
| Un-register the active object from the framework. More...
|
|
virtual void | init (void const *const e, std::uint_fast8_t const qs_id) |
| Executes the top-most initial transition in QP::QHsm. More...
|
|
virtual void | init (std::uint_fast8_t const qs_id) |
| overloaded init(qs_id) More...
|
|
virtual void | dispatch (QEvt const *const e, std::uint_fast8_t const qs_id) |
| Dispatches an event to QP::QHsm. More...
|
|
QStateHandler | state () const noexcept |
| Obtain the current state (state handler function) More...
|
|
virtual QStateHandler | getStateHandler () noexcept |
| Get the current state handler of the QP::QHsm. More...
|
|
bool | isIn (QStateHandler const s) noexcept |
| Tests if a given state is part of the current active state configuration. More...
|
|
QStateHandler | childState (QStateHandler const parent) noexcept |
| Obtain the current active child state of a given parent. More...
|
|
|
enum | ReservedHsmSignals : QSignal { Q_ENTRY_SIG = 1U
, Q_EXIT_SIG
, Q_INIT_SIG
} |
| Reserved signals by the HSM-style state machine implementation strategy. More...
|
|
enum | QStateRet : std::uint_fast8_t {
Q_RET_SUPER
, Q_RET_SUPER_SUB
, Q_RET_UNHANDLED
, Q_RET_HANDLED
,
Q_RET_IGNORED
, Q_RET_ENTRY
, Q_RET_EXIT
, Q_RET_NULL
,
Q_RET_TRAN
, Q_RET_TRAN_INIT
, Q_RET_TRAN_EP
, Q_RET_TRAN_HIST
,
Q_RET_TRAN_XP
} |
| All possible return values from state-handlers. More...
|
|
std::uint8_t | m_prio |
| QF priority (1..QF_MAX_ACTIVE) of this active object. More...
|
|
| QActive (QStateHandler const initial) noexcept |
| protected constructor (abstract class) More...
|
|
| QHsm (QStateHandler const initial) noexcept |
| protected constructor of QHsm More...
|
|
QState | tran (QStateHandler const target) noexcept |
| Helper function to specify a state transition. More...
|
|
QState | tran_hist (QStateHandler const hist) noexcept |
| Helper function to specify a transition to history. More...
|
|
QState | super (QStateHandler const superstate) noexcept |
| Helper function to specify the superstate of a given state. More...
|
|
QState | qm_tran (void const *const tatbl) noexcept |
| Helper function to specify a regular state transition in a QM state-handler. More...
|
|
QState | qm_tran_init (void const *const tatbl) noexcept |
| Helper function to specify an initial state transition in a QM state-handler. More...
|
|
QState | qm_tran_hist (QMState const *const hist, void const *const tatbl) noexcept |
| Helper function to specifiy a transition to history in a QM state-handler. More...
|
|
QState | qm_tran_ep (void const *const tatbl) noexcept |
| Helper function to specify a transition to an entry point to a submachine state in a QM state-handler. More...
|
|
QState | qm_tran_xp (QActionHandler const xp, void const *const tatbl) noexcept |
| Helper function to specify a transition to an exit point from a submachine state in a QM state-handler. More...
|
|
QState | qm_entry (QMState const *const s) noexcept |
| Helper function to specify a state entry in a QM state-handler. More...
|
|
QState | qm_exit (QMState const *const s) noexcept |
| Helper function to specify a state exit in a QM state-handler. More...
|
|
QState | qm_sm_exit (QMState const *const s) noexcept |
| Helper function to specify a submachine exit in a QM state-handler. More...
|
|
QState | qm_super_sub (QMState const *const s) noexcept |
| Helper function to call in a QM state-handler when it passes the event to the host submachine state to handle an event. More...
|
|
QP::QXThread represents the extended (blocking) thread of the QXK kernel. Each blocking thread in the application must be represented by the corresponding QP::QXThread instance
- Note
- Typically QP::QXThread is instantiated directly in the application code. The customization of the thread occurs in the constructor, where you provide the thread-handler function as the parameter.
- See also
- QP::QActive
- Usage
- The following example illustrates how to instantiate and use an extended thread in your application.
while (1) {
for (std::uint32_t volatile i; = 1500U; i != 0U; --i) {
BSP_ledGreenOn();
BSP_ledGreenOff();
}
}
}
std::uint32_t stack_blinky[80];
int main() {
. . .
blinky.start(5U,
nullptr, 0,
stack_blinky, sizeof(stack_blinky),
nullptr);
. . .
}
Extended (blocking) thread of the QXK preemptive kernel.
static bool delay(std::uint_fast16_t const nTicks) noexcept
delay (block) the current extended thread for a specified # ticks
int_t run()
Transfers control to QF to run the application.
Definition at line 181 of file qxk.hpp.