QP/C  7.2.2
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QTicker Class Reference

"Ticker" Active Object class More...

#include "qf.h"

Inheritance diagram for QTicker:
QActive QHsm

Public Member Functions

void QTicker_ctor (QTicker *const me, uint_fast8_t const tickRate)
 
- Public Member Functions inherited from QActive
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)
 
void QActive_setAttr (QActive *const me, uint32_t attr1, void const *attr2)
 
- Public Member Functions inherited from QHsm
bool QHsm_isIn (QHsm *const me, QStateHandler const state)
 
QStateHandler QHsm_childState (QHsm *const me, QStateHandler const parent)
 

Public Attributes

QActive super
 
- Public Attributes inherited from QActive
QHsm super
 

Private Member Functions

void QTicker_init_ (QHsm *const me, void const *const par, uint_fast8_t const qs_id)
 
void QTicker_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 
bool QTicker_post_ (QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender)
 
void QTicker_postLIFO_ (QActive *const me, QEvt const *const e)
 

Additional Inherited Members

- Static Public Member Functions inherited from QActive
void QActive_psInit (QSubscrList *const subscrSto, enum_t const maxSignal)
 
- 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 const initial)
 
void QActive_stop (QActive *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_register_ (QActive *const me)
 
void QActive_unregister_ (QActive *const me)
 
- Protected Member Functions inherited from QHsm
void QHsm_ctor (QHsm *const me, QStateHandler const initial)
 
QState QHsm_top (QHsm const *const me, QEvt const *const e)
 
void QHsm_init_ (QHsm *const me, void const *const e, uint_fast8_t const qs_id)
 
void QHsm_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 

Detailed Description

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 QTIMEEVT_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_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_)
Definition: qf.h:1907
#define QACTIVE_POST(me_, e_, sender_)
Definition: qf.h:1939
Event class.
Definition: qep.h:167
"Ticker" Active Object class
Definition: qf.h:1353
QActive super
Definition: qf.h:1355

Definition at line 1353 of file qf.h.

Member Function Documentation

◆ QTicker_ctor()

void QTicker_ctor ( QTicker *const  me,
uint_fast8_t const  tickRate 
)

Constructor of the QTicker Active Object class

Definition at line 347 of file qf_actq.c.

◆ QTicker_init_()

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

initialization (override)

Definition at line 370 of file qf_actq.c.

◆ QTicker_dispatch_()

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

dispatching (override)

Definition at line 384 of file qf_actq.c.

◆ QTicker_post_()

bool QTicker_post_ ( QActive *const  me,
QEvt const *const  e,
uint_fast16_t const  margin,
void const *const  sender 
)
private

post (override)

Definition at line 405 of file qf_actq.c.

◆ QTicker_postLIFO_()

void QTicker_postLIFO_ ( QActive *const  me,
QEvt const *const  e 
)
private

post-LIFO (override)

Definition at line 447 of file qf_actq.c.

Member Data Documentation

◆ super

QActive QTicker::super

Definition at line 1355 of file qf.h.


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