Sample QP/C port.
More...
#include <stdint.h>
#include <stdbool.h>
#include "qequeue.h"
#include "qmpool.h"
#include "qp.h"
#include "qk.h"
Go to the source code of this file.
Sample QP/C port.
- Details
- 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.h.
◆ Q_NORETURN
#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 C99 specifier _Noreturn
.
- Note
- The
Q_NORETURN
macro can be defined in the QP port (typically in qep_port.h
). If such definition is provided the default won't be used.
Definition at line 23 of file qp_port.h.
◆ QACTIVE_EQUEUE_TYPE
#define QACTIVE_EQUEUE_TYPE QEQueue |
QActive event queue type used in various QP/C ports.
Definition at line 27 of file qp_port.h.
◆ QACTIVE_OS_OBJ_TYPE
#define QACTIVE_OS_OBJ_TYPE void* |
QActive "OS-object" type used in various QP/C ports.
Definition at line 30 of file qp_port.h.
◆ QACTIVE_THREAD_TYPE
#define QACTIVE_THREAD_TYPE void const * |
QActive "thread" type used in various QP/C ports.
Definition at line 33 of file qp_port.h.
◆ QF_INT_DISABLE
#define QF_INT_DISABLE |
( |
| ) |
intDisable() |
Disable interrupts.
Definition at line 37 of file qp_port.h.
◆ QF_INT_ENABLE
#define QF_INT_ENABLE |
( |
| ) |
intEnable() |
Enable interrupts.
Definition at line 40 of file qp_port.h.
◆ QF_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.
- Note
- This macro might be empty, in which case the critical section status is not saved or restored. Such critical sections won't be able to nest. Also, note that the macro should be invoked without the closing semicolon.
Definition at line 55 of file qp_port.h.
◆ QF_CRIT_ENTRY
#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 64 of file qp_port.h.
◆ QF_CRIT_EXIT
#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 72 of file qp_port.h.
◆ QV_CPU_SLEEP
Value:do { \
__disable_interrupt(); \
QF_INT_ENABLE(); \
__WFI(); \
__enable_interrupt(); \
} while (false)
! 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 94 of file qp_port.h.
◆ QK_ISR_CONTEXT_
#define QK_ISR_CONTEXT_ |
( |
| ) |
(QK_priv_.intNest != 0U) |
Check if the code executes in the ISR context
Definition at line 105 of file qp_port.h.
◆ QK_ISR_ENTRY
Value:do { \
QF_INT_DISABLE(); \
++QK_priv_.intNest; \
QF_QS_ISR_ENTRY(QK_priv_.intNest, QK_currPrio_); \
QF_INT_ENABLE(); \
} while (false)
Define the ISR entry sequence
Definition at line 108 of file qp_port.h.
◆ QK_ISR_EXIT
Value:do { \
QF_INT_DISABLE(); \
--QK_priv_.intNest; \
if (QK_priv_.intNest == 0U) { \
if (QK_sched_() != 0U) { \
QK_activate_(); \
} \
} \
QF_INT_ENABLE(); \
} while (false)
Define the ISR exit sequence
Definition at line 117 of file qp_port.h.
◆ QXK_ISR_CONTEXT_
#define QXK_ISR_CONTEXT_ |
( |
| ) |
(QXK_get_IPSR() != 0U) |
Check if the code executes in the ISR context.
Definition at line 131 of file qp_port.h.
◆ QXK_CONTEXT_SWITCH_
#define QXK_CONTEXT_SWITCH_ |
( |
| ) |
(trigPendSV()) |
Trigger context switch (used internally in QXK only)
Definition at line 134 of file qp_port.h.
◆ QXK_ISR_ENTRY
#define QXK_ISR_ENTRY |
( |
| ) |
((void)0) |
Define the ISR entry sequence.
Definition at line 137 of file qp_port.h.
◆ QXK_ISR_EXIT
Value: do { \
QF_INT_DISABLE(); \
if (QXK_sched_() != 0U) { \
} \
QF_INT_ENABLE(); \
QXK_ARM_ERRATUM_838869(); \
} while (false)
#define Q_UINT2PTR_CAST(type_, uint_)
Perform cast from unsigned integer uint_ to pointer of type type_
Define the ISR exit sequence.
Definition at line 140 of file qp_port.h.
◆ crit_stat_t
◆ critEntry()
◆ critExit()