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

#include <qf.h>

Inheritance diagram for QTicker:
QActive QHsm

Public Member Functions

void QTicker_ctor (QTicker *const me, uint_fast8_t tickRate)
 
- Public Member Functions inherited from QHsm
QStateHandler QHsm_childState (QHsm *const me, QStateHandler const parent)
 
bool QHsm_isIn (QHsm *const me, QStateHandler const state)
 

Protected Attributes

QActive super
 
- Protected Attributes inherited from QActive
QHsm super
 

Static Private Member Functions

static void QTicker_init_ (QHsm *const me, void const *par, uint_fast8_t const qs_id)
 
static void QTicker_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 
static void QTicker_postLIFO_ (QActive *const me, QEvt const *const e)
 

Additional Inherited Members

- Static Public Member Functions inherited from QHsm
static QStateHandler QHsm_state (QHsm *const me)
 
- 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)
 

Detailed Description

"Ticker" Active Object class

QTicker is an efficient active object specialized to process QF system clock tick at a specified tick rate [0..QF_MAX_TICK_RATE]. Placing system clock tick processing in an active object allows you to remove the non-deterministic QF_TICK_X() processing from the interrupt level and move it into the thread-level, where you can prioritize it as low as you wish.

Usage
The following example illustrates use of QTicker active objects:
/* bsp.h ----------------- */
extern QTicker ticker0; /* "ticker" AO for clock rate 0 */
extern QTicker ticker1; /* "ticker" AO for clock rate 1 */
/* bsp.c ----------------- */
QTicker ticker0; /* "ticker" AO for clock rate 0 */
QTicker ticker1; /* "ticker" AO for clock rate 1 */
/* system clock tick ISR for clock rate 0 */
void SysTick_Handler(void) {
. . .
QACTIVE_POST(&ticker0.super, (QEvt *)0, &qs_tick0_id);
. . .
}
/* system clock tick ISR for clock rate 1 */
void Timer0A_IRQHandler(void) {
. . .
QACTIVE_POST(&ticker1.super, (QEvt *)0, &qs_tick1_id);
. . .
}
/* main.c --------------- */
main () {
. . .
QACTIVE_START(&ticker0.super,
1U, /* priority */
0, 0, 0, 0, 0); /* not used */
QACTIVE_START(&ticker1.super,
2U, /* priority */
0, 0, 0, 0, 0); /* not used */
. . .
}
#define QACTIVE_START(me_, prio_, qSto_, qLen_, stkSto_, stkLen_, par_)
Definition: qf.h:206
#define QACTIVE_POST(me_, e_, sender_)
Definition: qf.h:238
Definition: qep.h:119
Definition: qf.h:894
QActive super
Definition: qf.h:895

Definition at line 894 of file qf.h.

Member Function Documentation

◆ QTicker_ctor()

void QTicker_ctor ( QTicker *const  me,
uint_fast8_t  tickRate 
)

Constructor of the QTicker Active Object class

Definition at line 419 of file qf_actq.c.

◆ QTicker_init_()

static void QTicker_init_ ( QHsm *const  me,
void const *  par,
uint_fast8_t const  qs_id 
)
staticprivate

Definition at line 440 of file qf_actq.c.

◆ QTicker_dispatch_()

static void QTicker_dispatch_ ( QHsm *const  me,
QEvt const *const  e,
uint_fast8_t const  qs_id 
)
staticprivate

Definition at line 456 of file qf_actq.c.

◆ QTicker_postLIFO_()

static void QTicker_postLIFO_ ( QActive *const  me,
QEvt const *const  e 
)
staticprivate

Definition at line 522 of file qf_actq.c.

Field Documentation

◆ super

QActive super
protected

inherits QActive

Definition at line 895 of file qf.h.


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