This directory contains a generic platform-independent QP/C port to the Zephyr RTOS.
Typically, you should not need to change the files in this directory to adapt the QP/C-Zephyr port on any CPU/Compiler to which Zephyr has been ported, because all the CPU and compiler specifics are handled by the Zephyr RTOS.
The QP/C-Zephyr port works as follows:
k_spin_lock()/k_spin_unlock()
Zephyr API. This is the modern Zephyr critical section API, which is ready for SMP (symmetric multiprocessing).struct k_thread
) and requires a private stack space.examples/zephyr
folder, the private stacks for active objects in this port must be allocated with the Zephyr K_THREAD_STACK_DEFINE()
macro. Also, the stack size passed to QACTIVE_START() must be calculated with the Zephyr K_THREAD_STACK_SIZEOF()
macro. Failure to use these macros can lead to memory corruption in the application.struct k_msgq
).k_sched_lock()/k_sched_unlock()
), which locks all threads indiscriminately. Currently Zephyr does not provide a selective scheduler locking (with priority-ceiling).struct k_timer
) to tick periodically and invoke QF_TICK_X().QP/C Source Files Needed in the Zephyr port
It is important to note that not all QP/C source files should be included in the build process. Specifically, the QP/C source files qf_actq.c must NOT be included in the build, because this functionality is taken from Zephyr. Here is the list of QP/C source files needed:
qpc/ports
folder (as all other 3rd-party RTOS ports) because the port is packaged according to the rules of a "Zephyr Module". These rules require a "Zephyr Module" to be located directly in the qpc
folder.The example projects for this port are located in the examples/zephyr
folder.