Sample QP/C++ port. More...
Go to the source code of this file.
Macros | |
#define | Q_NORETURN [[ noreturn ]] void |
No-return specifier for the Q_onError() callback function. | |
#define | QACTIVE_EQUEUE_TYPE QEQueue |
QP::QActive event queue type used in various QP/C++ ports. | |
#define | QACTIVE_OS_OBJ_TYPE void* |
QP::QActive "OS-object" type used in various QP/C++ ports. | |
#define | QACTIVE_THREAD_TYPE void const * |
QP::QActive "thread" type used in various QP/C++ ports. | |
#define | QF_INT_DISABLE() intDisable() |
Disable interrupts. | |
#define | QF_INT_ENABLE() intEnable() |
Enable interrupts. | |
#define | QF_CRIT_STAT std::uint32_t crit_stat_; |
#define | QF_CRIT_ENTRY() (crit_stat_ = critEntry()) |
#define | QF_CRIT_EXIT() critExit(crit_stat_) |
#define | QV_CPU_SLEEP() |
! def QF_MEM_ISOLATE | |
#define | QK_ISR_CONTEXT_() (QK_priv_.intNest != 0U) |
#define | QK_ISR_ENTRY() |
Define the ISR entry sequence. | |
#define | QK_ISR_EXIT() |
#define | QXK_ISR_CONTEXT_() (QXK_get_IPSR() != 0U) |
Check if the code executes in the ISR context. | |
#define | QXK_CONTEXT_SWITCH_() (trigPendSV()) |
Trigger context switch (used internally in QXK only) | |
#define | QXK_ISR_ENTRY() ((void)0) |
Define the ISR entry sequence. | |
#define | QXK_ISR_EXIT() |
Define the ISR exit sequence. | |
Functions | |
void | intDisable (void) |
void | intEnable (void) |
std::uint32_t | critEntry (void) |
void | critExit (std::uint32_t stat) |
std::uint32_t | QK_get_IPSR (void) |
Sample QP/C++ port.
This is just an example of a QF port for a generic C99 compiler. Other specific QF ports will define the QF facilities differently.
Definition in file qp_port.hpp.
#define Q_NORETURN [[ noreturn ]] void |
No-return specifier for the Q_onError() callback function.
If the Q_NORETURN
macro is undefined, the default definition uses the C++11 specifier [[ noreturn ]]
.
Q_NORETURN
macro can be defined in the QP port (typically in qep_port.hpp
). If such definition is provided the default won't be used. Definition at line 22 of file qp_port.hpp.
#define QACTIVE_EQUEUE_TYPE QEQueue |
QP::QActive event queue type used in various QP/C++ ports.
Definition at line 26 of file qp_port.hpp.
#define QACTIVE_OS_OBJ_TYPE void* |
QP::QActive "OS-object" type used in various QP/C++ ports.
Definition at line 29 of file qp_port.hpp.
#define QACTIVE_THREAD_TYPE void const * |
QP::QActive "thread" type used in various QP/C++ ports.
Definition at line 32 of file qp_port.hpp.
#define QF_INT_DISABLE | ( | ) | intDisable() |
Disable interrupts.
Definition at line 36 of file qp_port.hpp.
#define QF_INT_ENABLE | ( | ) | intEnable() |
Enable interrupts.
Definition at line 39 of file qp_port.hpp.
#define QF_CRIT_STAT std::uint32_t crit_stat_; |
Define the critical section status that was present before entering the critical section.
For critical sections that are allowed to nest, the critical section status must be saved and restored at the end. This macro provides the storage for saving the status.
Definition at line 54 of file qp_port.hpp.
#define QF_CRIT_ENTRY | ( | ) | (crit_stat_ = critEntry()) |
Enter the critical section
If the critical section status is provided, the macro saves the critical section status from before entering the critical section. Otherwise, the macro just unconditionally enters the critical section without saving the status.
Definition at line 63 of file qp_port.hpp.
#define QF_CRIT_EXIT | ( | ) | critExit(crit_stat_) |
Exit the critical section
If the critical section status is provided, the macro restores the critical section status saved by QF_CRIT_ENTRY(). Otherwise, the macro just unconditionally exits the critical section.
Definition at line 71 of file qp_port.hpp.
#define QV_CPU_SLEEP | ( | ) |
! def QF_MEM_ISOLATE
Macro to put the CPU to sleep safely in the non-preemptive QV kernel (to be called from QV::onIdle()).
Definition at line 100 of file qp_port.hpp.
#define QK_ISR_CONTEXT_ | ( | ) | (QK_priv_.intNest != 0U) |
Check if the code executes in the ISR context
Definition at line 111 of file qp_port.hpp.
#define QK_ISR_ENTRY | ( | ) |
Define the ISR entry sequence.
Definition at line 114 of file qp_port.hpp.
#define QK_ISR_EXIT | ( | ) |
Define the ISR exit sequence
Definition at line 123 of file qp_port.hpp.
#define QXK_ISR_CONTEXT_ | ( | ) | (QXK_get_IPSR() != 0U) |
Check if the code executes in the ISR context.
Definition at line 137 of file qp_port.hpp.
#define QXK_CONTEXT_SWITCH_ | ( | ) | (trigPendSV()) |
Trigger context switch (used internally in QXK only)
Definition at line 140 of file qp_port.hpp.
#define QXK_ISR_ENTRY | ( | ) | ((void)0) |
Define the ISR entry sequence.
Definition at line 143 of file qp_port.hpp.
#define QXK_ISR_EXIT | ( | ) |
Define the ISR exit sequence.
Definition at line 146 of file qp_port.hpp.
void intDisable | ( | void | ) |
void intEnable | ( | void | ) |
std::uint32_t critEntry | ( | void | ) |
void critExit | ( | std::uint32_t | stat | ) |
std::uint32_t QK_get_IPSR | ( | void | ) |