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

"Ticker" Active Object class More...

#include "qp.h"

Inheritance diagram for QTicker:
QActive QAsm

Public Member Functions

void QTicker_ctor (QTicker *const me, uint_fast8_t const tickRate)
 
- Public Member Functions inherited from QActive
void QActive_setAttr (QActive *const me, uint32_t attr1, void const *attr2)
 

Public Attributes

QActive super
 
- Public Attributes inherited from QActive
QAsm super
 

Private Member Functions

void QTicker_init_ (QAsm *const me, void const *const par, uint_fast8_t const qsId)
 
void QTicker_dispatch_ (QAsm *const me, QEvt const *const e, uint_fast8_t const qsId)
 
void QTicker_trig_ (QActive *const me, void const *const sender)
 

Additional Inherited Members

- Static Public Member Functions inherited from QActive
void QActive_psInit (QSubscrList *const subscrSto, enum_t const maxSignal)
 
- Protected Member Functions inherited from QActive
void QActive_ctor (QActive *const me, QStateHandler const 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, struct QEQueue *const eq, QEvt const *const e)
 
bool QActive_recall (QActive *const me, struct QEQueue *const eq)
 
uint_fast16_t QActive_flushDeferred (QActive const *const me, struct QEQueue *const eq, uint_fast16_t const num)
 
- Protected Member Functions inherited from QAsm
void QAsm_ctor (QAsm *const me)
 
QState QHsm_top (QHsm const *const me, QEvt const *const e)
 
- Protected Attributes inherited from QActive
uint8_t prio
 
uint8_t pthre
 
QACTIVE_THREAD_TYPE thread
 
QACTIVE_OS_OBJ_TYPE osObject
 
QACTIVE_EQUEUE_TYPE eQueue
 
uint8_t prio_dis
 
uint8_t pthre_dis
 
- Protected Attributes inherited from QAsm
struct QAsmVtable const * vptr
 
union QAsmAttr state
 
union QAsmAttr temp
 

Detailed Description

"Ticker" Active Object class

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 QActive * const the_Ticker0; // "ticker" pointer for clock rate 0
extern QActive * const the Ticker1; // "ticker" pointer for clock rate 1
// bsp.c -----------------
static QTicker l_ticker0; // "ticker" instance for clock rate 0
QActive * const the_Ticker0 = &l_ticker0.super;
static QTicker l_ticker1; // "ticker" instance for clock rate 1
QActive * const the_Ticker1 = &l_ticker1.super;
// clock tick ISR for tick rate 0
void SysTick_Handler(void) {
. . .
QTICKER_TRIG(the_Ticker0, &qs_tick0_id);
. . .
}
// clock tick ISR for tick rate 1
void Timer0A_IRQHandler(void) {
. . .
QTICKER_TRIG(the_Ticker1, &qs_tick1_id);
. . .
}
// main.c ---------------
main () {
. . .
QACTIVE_START(the_Ticker0,
1U, // priority
0, 0, 0, 0, 0); // not used
QACTIVE_START(the_Ticker1,
2U, // priority
0, 0, 0, 0, 0); // not used
. . .
}
#define QACTIVE_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_)
Definition qp.h:1197
#define QTICKER_TRIG(ticker_, sender_)
Definition qp.h:1255
Active object class (based on the QHsm implementation strategy)
Definition qp.h:800
"Ticker" Active Object class
Definition qp.h:1042
QActive super
Definition qp.h:1044

Definition at line 1042 of file qp.h.

Member Function Documentation

◆ QTicker_ctor()

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

Constructor of the QTicker Active Object class

Definition at line 372 of file qf_actq.c.

◆ QTicker_init_()

void QTicker_init_ ( QAsm *const  me,
void const *const  par,
uint_fast8_t const  qsId 
)
private

Definition at line 393 of file qf_actq.c.

◆ QTicker_dispatch_()

void QTicker_dispatch_ ( QAsm *const  me,
QEvt const *const  e,
uint_fast8_t const  qsId 
)
private

Definition at line 414 of file qf_actq.c.

◆ QTicker_trig_()

QTicker::QTicker_trig_ ( QActive *const  me,
void const *const  sender 
)
private

Asynchronously trigger the QTicker active object to perform tick processing.

Description
This function only triggers the given "ticker" AO. The actual clock-tick processing happens in the thread context of the "ticker" AO, running at the configured priority level.

Definition at line 439 of file qf_actq.c.

Member Data Documentation

◆ super

QActive QTicker::super

Definition at line 1044 of file qp.h.


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