QP/C  7.0.0
Real-Time Embedded Framework
QXThread Struct Reference

#include <qxthread.h>

Inheritance diagram for QXThread:
QActive QHsm

Public Member Functions

bool QXThread_delayCancel (QXThread *const me)
 
- Public Member Functions inherited from QHsm
QStateHandler QHsm_childState (QHsm *const me, QStateHandler const parent)
 
bool QHsm_isIn (QHsm *const me, QStateHandler const state)
 

Static Public Member Functions

bool QXThread_delay (uint_fast16_t const nTicks)
 
QEvt const * QXThread_queueGet (uint_fast16_t const nTicks)
 
- Static Public Member Functions inherited from QHsm
static QStateHandler QHsm_state (QHsm *const me)
 

Data Fields

QActive super
 
QTimeEvt timeEvt
 

Additional Inherited Members

- Protected Member Functions inherited from QActive
void QActive_ctor (QActive *const me, QStateHandler initial)
 
void QActive_stop (QActive *const me)
 
void QActive_subscribe (QActive const *const me, enum_t const sig)
 
void QActive_unsubscribe (QActive const *const me, enum_t const sig)
 
void QActive_unsubscribeAll (QActive const *const me)
 
bool QActive_defer (QActive const *const me, QEQueue *const eq, QEvt const *const e)
 
bool QActive_recall (QActive *const me, QEQueue *const eq)
 
uint_fast16_t QActive_flushDeferred (QActive const *const me, QEQueue *const eq)
 
void QActive_setAttr (QActive *const me, uint32_t attr1, void const *attr2)
 
- Protected Member Functions inherited from QHsm
void QHsm_ctor (QHsm *const me, QStateHandler initial)
 
QState QHsm_top (void const *const me, QEvt const *const e)
 
- Protected Attributes inherited from QActive
QHsm super
 

Detailed Description

eXtended (blocking) thread of the QXK preemptive kernel

QXThread represents the eXtended (blocking) thread of the QXK preemptive 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.
See also
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) {
uint32_t volatile i;
for (i = 1500U; i != 0U; --i) {
BSP_ledGreenOn();
BSP_ledGreenOff();
}
QXThread_delay(1U); /* block for 1 tick */
}
}
int main() {
. . .
/* initialize and start blinky thread */
QXThread_ctor(&blinky, &main_blinky, 0);
static uint32_t stack_blinky[80]; /* stack for the thread */
QXTHREAD_START(&blinky,
5U, /* priority */
(void *)0, 0, /* message queue (not used) */
stack_blinky, sizeof(stack_blinky), /* stack */
(void *)0); /* extra parameter (not used) */
. . .
return QF_run(); /* run the application */
}
#define Q_DEFINE_THIS_FILE
Definition: qassert.h:87
int_t QF_run(void)
Definition: qk.c:124
QP/C public interface including backwards-compatibility layer.
#define QXTHREAD_START(me_, prio_, qSto_, qLen_, stkSto_, stkSize_, par_)
Definition: qxthread.h:91
void QXThread_ctor(QXThread *const me, QXThreadHandler handler, uint_fast8_t tickRate)
Definition: qxk_xthr.c:104
bool QXThread_delay(uint_fast16_t const nTicks)
Definition: qxk_xthr.c:649

Definition at line 63 of file qxthread.h.

Member Function Documentation

◆ QXThread_delay()

bool QXThread_delay ( uint_fast16_t const  nTicks)
static

delay (block) the current extended thread for a specified # ticks

Definition at line 649 of file qxk_xthr.c.

◆ QXThread_delayCancel()

bool QXThread_delayCancel ( QXThread *const  me)

cancel the delay

Definition at line 698 of file qxk_xthr.c.

◆ QXThread_queueGet()

QEvt const * QXThread_queueGet ( uint_fast16_t const  nTicks)
static

obtain a message from the private message queue (block if no messages)

Definition at line 448 of file qxk_xthr.c.

Field Documentation

◆ super

QActive super

inherited QActive

Definition at line 64 of file qxthread.h.

◆ timeEvt

QTimeEvt timeEvt

time event to handle blocking timeouts

Definition at line 65 of file qxthread.h.


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