QP/C platform-independent public interface. More...
Go to the source code of this file.
Classes | |
class | QEvt |
Event class. More... | |
struct | QMState |
State object for the QMsm class (QM State Machine) More... | |
struct | QMTranActTable |
Transition-Action Table for the QMsm State Machine. More... | |
union | QAsmAttr |
Attribute of for the QAsm class (Abstract State Machine) More... | |
class | QAsm |
Abstract State Machine class (state machine interface) More... | |
struct | QAsmVtable |
Virtual table for the QAsm class. More... | |
class | QHsm |
Hierarchical State Machine class (QHsm-style state machine implementation strategy) More... | |
class | QMsm |
Hierarchical State Machine class (QMsm-style state machine implementation strategy) More... | |
class | QPSet |
Set of Active Objects of up to QF_MAX_ACTIVE elements. More... | |
struct | QSubscrList |
Subscriber List (for publish-subscribe) More... | |
class | QActive |
Active object class (based on the QHsm implementation strategy) More... | |
class | QMActive |
Active object class (based on QMsm implementation strategy) More... | |
class | QTimeEvt |
Time Event class. More... | |
class | QTicker |
"Ticker" Active Object class More... | |
Macros | |
#define | QP_VERSION_STR "7.4.0-rc.3" |
Version string complying with Semantic Versioning | |
#define | QP_VERSION 740U |
Version number for internal use (must correspond to QP_VERSION_STR) | |
#define | QP_RELEASE 0x7092C3BBU |
Encrypted current QP release for internal use (7.3.5 on 2024-05-31) | |
#define | QEVT_MARKER 0xE0U |
QEvt memory marker (for internal integrity checks) | |
#define | QEVT_DYNAMIC 0U |
dummy parameter for dynamic event initialization (see QEvt::QEvt_init()) | |
#define | QEVT_INITIALIZER(sig_) |
Initializer for immutable (constant) QEvt instances. | |
#define | QASM_INIT(me_, par_, qsId_) |
QVirtual call to the top-most initial transition in a HSM. | |
#define | QASM_DISPATCH(me_, e_, qsId_) |
Virtual call to dispatch an event to a HSM. | |
#define | QASM_IS_IN(me_, state_) |
Virtual call to check whether a SM is in a given state. | |
#define | Q_ASM_UPCAST(ptr_) |
Perform upcasting from a subclass of QAsm to the base class QAsm. | |
#define | Q_HSM_UPCAST(ptr_) |
Perform upcasting from a subclass of QHsm to the base class QHsm. | |
#define | Q_MSM_UPCAST(ptr_) |
Perform upcasting from a subclass of QMsm to the base class QMsm. | |
#define | Q_TRAN(target_) |
Take transition to the specified target_ state. | |
#define | Q_TRAN_HIST(hist_) |
Take transition to the specified history of a given state. Applicable only to HSMs. | |
#define | Q_SUPER(super_) |
Designates the superstate of a given state. Applicable only to QHsm subclasses. | |
#define | Q_HANDLED() |
Indicate that an action has been "handled". Applies to entry/exit actions and to internal transitions. | |
#define | Q_UNHANDLED() |
Indicate that an internal transition has been "unhandled" due to a guard condition. | |
#define | Q_ACTION_NULL ((QActionHandler)0) |
Macro to provide strictly-typed zero-action to terminate action lists in the transition-action-tables. | |
#define | Q_EVT_CAST(class_) |
Perform downcast of an event onto a subclass of QEvt class_ | |
#define | Q_STATE_CAST(handler_) |
Perform cast to QStateHandler. | |
#define | Q_ACTION_CAST(action_) |
Perform cast to QActionHandler. | |
#define | Q_UNUSED_PAR(par_) |
Helper macro to clearly mark unused parameters of functions. | |
#define | Q_DIM(array_) |
#define | Q_UINT2PTR_CAST(type_, uint_) |
Perform cast from unsigned integer uint_ to pointer of type type_ | |
#define | QM_ENTRY(state_) |
Macro to call in a QM action-handler when it executes an entry action. Applicable only to QMsm subclasses. | |
#define | QM_EXIT(state_) |
Macro to call in a QM action-handler when it executes an exit action. Applicable only to QMsm subclasses. | |
#define | QM_SM_EXIT(state_) |
Macro to call in a QM submachine exit-handler. Applicable only to subclasses of QMsm. | |
#define | QM_TRAN(tatbl_) |
Macro to call in a QM state-handler when it executes a regular transition. Applicable only to QMsm subclasses. | |
#define | QM_TRAN_INIT(tatbl_) |
Macro to call in a QM state-handler when it executes an initial transition. Applicable only to QMsm subclasses. | |
#define | QM_TRAN_HIST(history_, tatbl_) |
Macro to call in a QM state-handler when it executes a transition to history. Applicable only to QMsm subclasses. | |
#define | QM_TRAN_EP(tatbl_) |
Macro to call in a QM state-handler when it executes a transition to the submachine via an entry point. | |
#define | QM_TRAN_XP(xp_, tatbl_) |
Macro to call in a QM state-handler when it executes a transition to exit point. Applicable only to QMsm subclasses. | |
#define | QM_HANDLED() |
Macro to call in a QM state-handler when it handled an event. Applicable only to QMsm subclasses. | |
#define | QM_UNHANDLED() |
Indicate that an internal transition has been "unhandled" due to a guard condition. Applicable only to QMsm subclasses. | |
#define | QM_SUPER() |
Macro to call in a QM state-handler when it designates the superstate to handle an event. Applicable only to QMSMs. | |
#define | QM_SUPER_SUB(host_) |
Macro to call in a QM submachine-handler when it designates the host state to handle an event. Applicable only to subclasses of QMsm. | |
#define | QM_STATE_NULL ((QMState *)0) |
Macro to provide strictly-typed zero-state to use for submachines. Applicable to subclasses of QMsm. | |
#define | QF_NO_MARGIN ((uint_fast16_t)0xFFFFU) |
Special value of margin that causes asserting failure in case event allocation or event posting fails. | |
#define | Q_PRIO(prio_, pthre_) |
Create a QPrioSpec object to specify priority of an AO or a thread. | |
#define | Q_NEW(evtT_, sig_, ...) |
Allocate a mutable (dynamic) event. | |
#define | Q_NEW_X(evtT_, margin_, sig_, ...) |
Non-asserting allocate a mutable (dynamic) event. | |
#define | Q_NEW_REF(evtRef_, evtT_) |
Create a new reference of the current event e | |
#define | Q_DELETE_REF(evtRef_) |
Delete the event reference. | |
#define | QACTIVE_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) |
Start an Active Object. | |
#define | QACTIVE_POST(me_, e_, sender_) |
Invoke the direct event posting facility QActive_post_(). | |
#define | QACTIVE_POST_X(me_, e_, margin_, sender_) |
Invoke the direct event posting facility QActive_post_() without delivery guarantee. | |
#define | QACTIVE_POST_LIFO(me_, e_) |
Post an event to an active object using the Last-In-First-Out (LIFO) policy. | |
#define | QACTIVE_PUBLISH(e_, sender_) |
Publish an event to all subscriber Active Objects. | |
#define | QTIMEEVT_TICK_X(tickRate_, sender_) |
Invoke the system clock tick processing QTimeEvt_tick_() | |
#define | QTIMEEVT_TICK(sender_) |
Invoke the system clock tick processing for tick rate 0. | |
#define | QTICKER_TRIG(ticker_, sender_) |
Asynchronously trigger the QTicker AO to perform tick processing. | |
#define | QF_CRIT_EXIT_NOP() |
No-operation for exiting a critical section. | |
#define | QF_TICK_X(tickRate_, sender_) |
Invoke the system clock tick processing. | |
#define | QF_TICK(sender_) |
Invoke the system clock tick processing. | |
#define | QF_PUBLISH(e_, sender_) |
#define | QF_MEM_SYS() |
#define | QF_MEM_APP() |
Typedefs | |
typedef int | int_t |
Alias for assertion-ID numbers in QP assertions and return from QF_run() | |
typedef int | enum_t |
typedef float | float32_t |
Alias for IEEE 754 32-bit floating point number. | |
typedef double | float64_t |
Alias for IEEE 754 64-bit floating point number. | |
typedef uint16_t | QSignal |
The signal of event QEvt. | |
typedef enum QStateRet | QState |
Type returned from state-handler functions. | |
typedef QState(* | QStateHandler) (void *const me, QEvt const *const e) |
Pointer to a state-handler function. | |
typedef QState(* | QActionHandler) (void *const me) |
Pointer to an action-handler function. | |
typedef void(* | QXThreadHandler) (struct QXThread *const me) |
Pointer to an extended-thread handler function. | |
typedef uint16_t | QPrioSpec |
Priority specification for Active Objects in QP. | |
typedef uint32_t | QTimeEvtCtr |
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE. | |
typedef uint32_t | QPSetBits |
Bitmask for the internal representation of QPSet elements. | |
Enumerations | |
enum | QStateRet { 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 } |
enum | QReservedSig { Q_EMPTY_SIG , Q_ENTRY_SIG , Q_EXIT_SIG , Q_INIT_SIG , Q_USER_SIG } |
Reserved signals by the QHsm-style state machine implementation. More... | |
Functions | |
uint_fast8_t | QF_LOG2 (QPSetBits const bitmask) |
Log-base-2 calculation when hardware acceleration is NOT provided (QF_LOG2 not defined) | |
Variables | |
char const | QP_versionStr [16] |
the current QP version number string in ROM, based on QP_VERSION_STR | |
QEvt const | QEvt_reserved_ [4] |
QP/C platform-independent public interface.
Definition in file qp.h.
#define QP_VERSION_STR "7.4.0-rc.3" |
Version string complying with Semantic Versioning
QP_VERSION_STR is a zero-terminated version string in the form MAJOR.MINOR.PATCH
compliant with Semantic Versioning.
#define QP_VERSION 740U |
Version number for internal use (must correspond to QP_VERSION_STR)
QP_VERSION is an unsigned integer constant of the form MAJOR|MINOR|PATCH
corresponding to QP_VERSION_STR, with digits merged together. For example QP_VERSION_STR == "7.3.5-rc.1" results in QP_VERSION == 735.
#define QP_RELEASE 0x7092C3BBU |
Encrypted current QP release for internal use (7.3.5 on 2024-05-31)
QP_RELEASE contains information about QP_VERSION (e.g., 735) and release date (e.g., 2023-06-30).
#define QEVT_MARKER 0xE0U |
QEvt memory marker (for internal integrity checks)
The marker is implanted in bits 4:7 of QEvt::evtTag_.
#define QEVT_DYNAMIC 0U |
dummy parameter for dynamic event initialization (see QEvt::QEvt_init())
#define QEVT_INITIALIZER | ( | sig_ | ) |
Initializer for immutable (constant) QEvt instances.
This macro encapsulates the ugly casting of enumerated signals and the generation of the memory marker for integrity check in the QEvt. evtTag_
attribute.
#define QASM_INIT | ( | me_, | |
par_, | |||
qsId_ ) |
QVirtual call to the top-most initial transition in a HSM.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | par_ | pointer the optional initialization parameter |
[in] | qsId_ | QS local filter ID (used only when Q_SPY is defined) |
The following example illustrates how to initialize a SM, and dispatch events to it:
#define QASM_DISPATCH | ( | me_, | |
e_, | |||
qsId_ ) |
Virtual call to dispatch an event to a HSM.
Processes one event at a time in Run-to-Completion fashion.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | e_ | constant pointer the QEvt or a class derived from QEvt (see Object Orientation) |
[in] | qsId_ | QS local filter ID (used only when Q_SPY is defined) |
The following example illustrates how to initialize a SM, and dispatch events to it:
#define QASM_IS_IN | ( | me_, | |
state_ ) |
Virtual call to check whether a SM is in a given state.
This macro applies to all QP state machines, that is subclasses of QHsm and QMsm.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | state_ | state handler (QStateHandler type) |
The following example illustrates how to check whether SM is in a given state:
#define Q_ASM_UPCAST | ( | ptr_ | ) |
Perform upcasting from a subclass of QAsm to the base class QAsm.
[in,out] | ptr_ | pointer to subclass of QAsm |
#define Q_HSM_UPCAST | ( | ptr_ | ) |
#define Q_MSM_UPCAST | ( | ptr_ | ) |
#define Q_TRAN | ( | target_ | ) |
Take transition to the specified target_
state.
#define Q_TRAN_HIST | ( | hist_ | ) |
Take transition to the specified history of a given state. Applicable only to HSMs.
#define Q_SUPER | ( | super_ | ) |
Designates the superstate of a given state. Applicable only to QHsm subclasses.
#define Q_HANDLED | ( | ) |
Indicate that an action has been "handled". Applies to entry/exit actions and to internal transitions.
#define Q_UNHANDLED | ( | ) |
Indicate that an internal transition has been "unhandled" due to a guard condition.
This macro must be called when a state-handler attempts to handle an event but a guard condition evaluates to 'false' and there is no other explicit way of handling the event. Applicable only to QHsm subclasses.
#define Q_ACTION_NULL ((QActionHandler)0) |
#define Q_EVT_CAST | ( | class_ | ) |
Perform downcast of an event onto a subclass of QEvt class_
This macro encapsulates the downcast of QEvt pointers, which violates MISRA-C:2023 Rule 11.3(R). This macro helps to localize this deviation.
class_ | a subclass of QEvt |
#define Q_STATE_CAST | ( | handler_ | ) |
Perform cast to QStateHandler.
This macro encapsulates the cast of a specific state handler function pointer to QStateHandler, which violates MISRA:C-2023 Rule 11.1(R). This macro helps to localize this deviation.
#define Q_ACTION_CAST | ( | action_ | ) |
Perform cast to QActionHandler.
This macro encapsulates the cast of a specific action handler function pointer to QActionHandler, which violates MISRA:C-2023 Rule 11.1(R). This macro helps to localize this deviation.
#define Q_UNUSED_PAR | ( | par_ | ) |
#define Q_DIM | ( | array_ | ) |
#define Q_UINT2PTR_CAST | ( | type_, | |
uint_ ) |
Perform cast from unsigned integer uint_
to pointer of type type_
This macro encapsulates the cast to (type_ *), which QP ports or application might use to access embedded hardware registers. Such uses can trigger PC-Lint "Note 923: cast from int to pointer" and this macro helps to encapsulate this deviation.
#define QM_ENTRY | ( | state_ | ) |
Macro to call in a QM action-handler when it executes an entry action. Applicable only to QMsm subclasses.
#define QM_EXIT | ( | state_ | ) |
Macro to call in a QM action-handler when it executes an exit action. Applicable only to QMsm subclasses.
#define QM_SM_EXIT | ( | state_ | ) |
Macro to call in a QM submachine exit-handler. Applicable only to subclasses of QMsm.
#define QM_TRAN | ( | tatbl_ | ) |
Macro to call in a QM state-handler when it executes a regular transition. Applicable only to QMsm subclasses.
#define QM_TRAN_INIT | ( | tatbl_ | ) |
Macro to call in a QM state-handler when it executes an initial transition. Applicable only to QMsm subclasses.
#define QM_TRAN_HIST | ( | history_, | |
tatbl_ ) |
Macro to call in a QM state-handler when it executes a transition to history. Applicable only to QMsm subclasses.
#define QM_TRAN_EP | ( | tatbl_ | ) |
Macro to call in a QM state-handler when it executes a transition to the submachine via an entry point.
#define QM_TRAN_XP | ( | xp_, | |
tatbl_ ) |
Macro to call in a QM state-handler when it executes a transition to exit point. Applicable only to QMsm subclasses.
#define QM_HANDLED | ( | ) |
Macro to call in a QM state-handler when it handled an event. Applicable only to QMsm subclasses.
#define QM_UNHANDLED | ( | ) |
Indicate that an internal transition has been "unhandled" due to a guard condition. Applicable only to QMsm subclasses.
This macro must be called when a state-handler attempts to handle an event but a guard condition evaluates to 'false' and there is no other explicit way of handling the event.
#define QM_SUPER | ( | ) |
Macro to call in a QM state-handler when it designates the superstate to handle an event. Applicable only to QMSMs.
#define QM_SUPER_SUB | ( | host_ | ) |
Macro to call in a QM submachine-handler when it designates the host state to handle an event. Applicable only to subclasses of QMsm.
#define QM_STATE_NULL ((QMState *)0) |
#define QF_NO_MARGIN ((uint_fast16_t)0xFFFFU) |
#define Q_PRIO | ( | prio_, | |
pthre_ ) |
Create a QPrioSpec object to specify priority of an AO or a thread.
[in] | prio_ | QF priority [1..QF_MAX_ACTIVE] |
[in] | pthre_ | Preemption threshold [1..QF_MAX_ACTIVE] |
prio_
in bits [0..7] and pthre_
in bits [8..15]. #define Q_NEW | ( | evtT_, | |
sig_, | |||
... ) |
Allocate a mutable (dynamic) event.
This macro allocates a mutable (dynamic) event and internally asserts that the allocation is successful. This means that the caller does not need to check the returned event pointer for validity because it is guaranteed to be not NULL.
The macro calls the internal QF function QF_newX_() with argument margin
== QF_NO_MARGIN, which causes an assertion failure when the event cannot be successfully allocated.
[in] | evtT_ | event type (class name) of the event to allocate |
[in] | sig_ | signal to assign to the newly allocated event |
evtT_
. init()
function needs to take at least one parameter and must return the event pointer (me
).The following example illustrates non-variadic version of Q_NEW() (when QEVT_PAR_INIT is NOT defined):
The following example illustrates variadic version of Q_NEW() and the RAII principle (Resource Acquisition Is Initialization) (when QEVT_PAR_INIT IS defined) :
#define Q_NEW_X | ( | evtT_, | |
margin_, | |||
sig_, | |||
... ) |
Non-asserting allocate a mutable (dynamic) event.
This macro allocates a mutable (dynamic) event, but only if the corresponding event pool has at least of margin
of free events left. If the event pool has insufficient number of events left, the macro returns NULL. The caller of this macro is responsible for checking the returned event pointer for NULL.
[in] | evtT_ | event type (class name) of the event to allocate |
[in] | margin_ | number of events that must remain available in the given pool after this allocation. The special value QF_NO_MARGIN causes asserting failure in case event allocation fails. |
[in] | sig_ | signal to assign to the newly allocated event |
evtT_
or NULL if the event cannot be allocated with the specified margin
of events still left in the event pool. init()
function needs to take at least one parameter and must return the event pointer (me
).The following example illustrates non-variadic version of Q_NEW_X() (when QEVT_PAR_INIT is NOT defined):
The following example illustrates variadic version of Q_NEW_X() and the RAII principle (Resource Acquisition Is Initialization) (when QEVT_PAR_INIT IS defined) :
#define Q_NEW_REF | ( | evtRef_, | |
evtT_ ) |
Create a new reference of the current event e
The current event processed by an active object is available only for the duration of the run-to-completion (RTC) step. After that step, the current event is no longer available and the framework might recycle (garbage-collect) the event. The macro Q_NEW_REF() explicitly creates a new reference to the current event that can be stored and used beyond the current RTC step, until the reference is explicitly recycled by means of the macro Q_DELETE_REF().
[in,out] | evtRef_ | event reference to create |
[in] | evtT_ | event type (class name) of the event reference |
The example defer in the directory examples/win32/defer
illustrates the use of Q_NEW_REF()
#define Q_DELETE_REF | ( | evtRef_ | ) |
Delete the event reference.
Every event reference created with the macro Q_NEW_REF() needs to be eventually deleted by means of the macro Q_DELETE_REF() to avoid leaking the event.
[in,out] | evtRef_ | event reference to delete |
The example defer in the directory examples/win32/defer
illustrates the use of Q_DELETE_REF()
#define QACTIVE_START | ( | me_, | |
prioSpec_, | |||
qSto_, | |||
qLen_, | |||
stkSto_, | |||
stkSize_, | |||
par_ ) |
Start an Active Object.
Starts execution of the AO and registers the AO with the framework.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | prioSpec_ | priority specification for the Active Object |
[in] | qSto_ | pointer to the storage for the ring buffer of the event queue (used only with the built-in QEQueue) |
[in] | qLen_ | length of the event queue (in events) |
[in] | stkSto_ | pointer to the stack storage (used only when per-AO stack is needed) |
[in] | stkSize_ | stack size (in bytes) |
[in] | par_ | pointer to the additional port-specific parameter(s) (might be NULL). |
#define QACTIVE_POST | ( | me_, | |
e_, | |||
sender_ ) |
Invoke the direct event posting facility QActive_post_().
This macro asserts if the queue overflows and cannot accept the event.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | e_ | pointer to the event to post |
[in] | sender_ | pointer to the sender object. |
sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, this macro does not use the sender_
parameter, so it does not need to be defined. sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, this macro does not use the sender_
parameter, so it does not need to be defined. #define QACTIVE_POST_X | ( | me_, | |
e_, | |||
margin_, | |||
sender_ ) |
Invoke the direct event posting facility QActive_post_() without delivery guarantee.
This macro does not assert if the queue overflows and cannot accept the event with the specified margin of free slots remaining.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | e_ | pointer to the event to post |
[in] | margin_ | the minimum free slots in the queue, which must still be available after posting the event. The special value QF_NO_MARGIN causes asserting failure in case event posting fails. |
[in] | sender_ | pointer to the sender object. |
sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, this macro does not use the sender_
parameter, so it does not need to be defined. sender
object is not necessarily a pointer to an active object. In fact, if QACTIVE_POST_X() is called from an interrupt or other context, you can create a unique object just to unambiguously identify the sender of the event.#define QACTIVE_POST_LIFO | ( | me_, | |
e_ ) |
Post an event to an active object using the Last-In-First-Out (LIFO) policy.
[in,out] | me_ | current instance pointer (see Object Orientation) |
[in] | e_ | pointer to the event to post |
#define QACTIVE_PUBLISH | ( | e_, | |
sender_ ) |
Publish an event to all subscriber Active Objects.
If Q_SPY is defined, this macro calls QActive_publish_() with the sender_
parameter to identify the publisher of the event. Otherwise, sender_
is not used.
[in] | e_ | pointer to the posted event |
[in] | sender_ | pointer to the sender object (actually used only when Q_SPY is defined) |
sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, the QACTIVE_PUBLISH() macro does not use the sender_
parameter, so it does not need to be defined. #define QTIMEEVT_TICK_X | ( | tickRate_, | |
sender_ ) |
Invoke the system clock tick processing QTimeEvt_tick_()
This macro is the recommended way of invoking clock tick processing, because it provides the vital information for software tracing and avoids any overhead when the tracing is disabled.
[in] | tickRate_ | clock tick rate to be serviced through this call |
[in] | sender_ | pointer to the sender object. This parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined) |
sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, this macro does not use the sender_
parameter, so it does not need to be defined. sender_
parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined). When QS software tracing is disabled, the QTIMEEVT_TICK_X() macro does not use the sender_
parameter, so it does not need to be defined. #define QTIMEEVT_TICK | ( | sender_ | ) |
Invoke the system clock tick processing for tick rate 0.
#define QTICKER_TRIG | ( | ticker_, | |
sender_ ) |
Asynchronously trigger the QTicker AO to perform tick processing.
This macro is the recommended way to trigger clock tick processing, because it provides the vital information for software tracing and avoids any overhead when the tracing is disabled.
[in] | ticker_ | pointer to the QTicker active object |
[in] | sender_ | pointer to the sender object. This parameter is actually only used when QS software tracing is enabled (macro Q_SPY is defined) |
sender_
parameter, so it does not need to be defined. sender_
object is not necessarily a pointer to an active object. In fact, when QTICKER_TRIG() is called from an interrupt, you would create a unique object just to unambiguously identify the ISR as the sender of the time events. #define QF_CRIT_EXIT_NOP | ( | ) |
No-operation for exiting a critical section.
In some QF ports the critical section exit takes effect only on the next machine instruction. If this next instruction is another entry to a critical section, the critical section won't be really exited, but rather the two adjacent critical sections would be merged. The QF_CRIT_EXIT_NOP() macro contains minimal code required to prevent such merging of critical sections in such merging of critical sections in QF ports, in which it can occur.
#define QF_TICK_X | ( | tickRate_, | |
sender_ ) |
Invoke the system clock tick processing.
#define QF_TICK | ( | sender_ | ) |
Invoke the system clock tick processing.
#define QF_PUBLISH | ( | e_, | |
sender_ ) |
typedef int int_t |
typedef float float32_t |
Alias for IEEE 754 32-bit floating point number.
typedef double float64_t |
Alias for IEEE 754 64-bit floating point number.
typedef uint16_t QSignal |
The signal of event QEvt.
The relationship between an event and a signal is as follows. A signal in UML is the specification of an asynchronous stimulus that triggers reactions, and as such is an essential part of an event. (The signal conveys the type of the occurrence–what happened?) However, an event can also contain additional quantitative information about the occurrence in form of event parameters.
typedef QState(* QActionHandler) (void *const me) |
typedef void(* QXThreadHandler) (struct QXThread *const me) |
typedef uint16_t QPrioSpec |
Priority specification for Active Objects in QP.
Active Object priorities in QP are integer numbers in the range [1..QF_MAX_ACTIVE], whereas the special priority number 0 is reserved for the lowest-priority idle thread. The QP framework uses the direct priority numbering, in which higher numerical values denote higher urgency. For example, an AO with priority 32 has higher urgency than an AO with priority 23.
QPrioSpec allows an application developer to assign two priorities to a given AO (see also Q_PRIO()):
In the QP native preemptive kernels, like QK, the "preemption-threshold" priority is used as to implement the "preemption-threshold scheduling" (PTS). It determines the conditions under which a given thread can be preempted by other threads. Specifically, a given thread can be preempted only by another thread with a higher priority than the "preemption-threshold" of the original thread.
typedef uint32_t QTimeEvtCtr |
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE.
The dynamic range of this data type determines the maximum block size that can be managed by the pool.
typedef uint32_t QPSetBits |
enum QStateRet |
All possible values returned from state/action handlers
enum QReservedSig |
Reserved signals by the QHsm-style state machine implementation.
uint_fast8_t QF_LOG2 | ( | QPSetBits const | bitmask | ) |
|
extern |
the current QP version number string in ROM, based on QP_VERSION_STR
|
extern |