QP/C  8.0.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QXThread Class Reference

eXtended (blocking) thread of the QXK preemptive kernel More...

Detailed Description

eXtended (blocking) thread of the QXK preemptive kernel

Details
QXThread represents the eXtended (blocking) thread of the QXK kernel. Each extended thread in the application must be represented by the corresponding QXThread instance
Note
Typically, QXThread is instantiated directly in the application code. The customization of the thread occurs in the QXThread_ctor(), where you provide the thread-handler function as the parameter.
Usage
The following example illustrates how to instantiate and use an extended thread in your application.
#include "qpc.h"
QXThread blinky; // QXK extended-thread object
void main_blinky(QXThread * const me) { // thread function
while (1) {
BSP_ledOn();
QXThread_delay(100U); // BLOCK
BSP_ledOff();
QXThread_delay(200U); // BLOCK
}
}
int main() {
. . .
// initialize and start blinky thread
QXThread_ctor(&blinky, &main_blinky, 0);
static uint64_t stack_blinky[40]; // stack for the thread
QXThread_start(&blinky,
5U, // priority
(void *)0, 0, // event queue (not used)
stack_blinky, sizeof(stack_blinky), // stack
(void *)0); // extra parameter (not used)
. . .
return QF_run(); // run the application
}
eXtended (blocking) thread of the QXK preemptive kernel
QP/C interface including the backwards-compatibility layer.

The documentation for this class was generated from the following file: