|
QP-nano
|
Active Object struct. More...
#include <qfn.h>
Data Fields | |
| QHsm | super |
| QTimeEvtCtr | tickCtr |
| Time Event tick counter for the active object. | |
| uint8_t | prio |
| priority of the active object (1..QF_MAX_ACTIVE) | |
| uint8_t | head |
| offset to where next event will be inserted into the buffer | |
| uint8_t | tail |
| offset of where next event will be extracted from the buffer | |
| uint8_t | nUsed |
| number of events currently present in the queue (events in the ring buffer + 1 event in the state machine) | |
Active Object struct.
QActive is the base structure for derivation of active objects. Active objects in QF-nano are encapsulated tasks (each embedding a state machine and an event queue) that communicate with one another asynchronously by sending and receiving events. Within an active object, events are processed sequentially in a run-to-completion (RTC) fashion, while QF encapsulates all the details of thread-safe event exchange and queuing.
The following example illustrates how to derive an active object from QActive. Please note that the QActive member super_ is defined as the FIRST member of the derived struct.
typedef struct PelicanTag { QActive super; /* derived from QActive */ uint8_t pedFlashCtr; /* pedestrian flash counter */ } Pelican; void Pelican_ctor(Pelican *me, uint8_t timeout); /* the ctor */
derives from the QHsm base structure
Definition at line 152 of file qfn.h.
Referenced by QK_sched_().
1.7.6.1