qf_tick.c File Reference

QF_tick() implementation. More...

#include "qf_pkg.h"

Go to the source code of this file.

Functions

void QF_tick (void)
 Processes all armed time events at every clock tick.

Detailed Description

QF_tick() implementation.

Definition in file qf_tick.c.


Function Documentation

void QF_tick ( void   ) 

Processes all armed time events at every clock tick.

This function must be called periodically from a time-tick ISR or from the highest-priority task so that QF can manage the timeout events.

Note:
The QF_tick() function is not reentrant meaning that it must run to completion before it is called again. Also, QF_tick() assumes that it never will get preempted by a task, which is always the case when it is called from an ISR or the highest-priority task.
See also:
QTimeEvt.

The following example illustrates the call to QF_tick():

/* case 1: Interrupt Controller available,
* "unconditional interrupt unlocking" critical section policy
* (nesting of critical sections _not_ allowed)
*/
interrupt void ISR_timer() {  /* entered with interrupts locked in hardware */
    QF_INT_UNLOCK(ignore);                             /* unlock interrupts */

    QF_tick();                            /*<-- call the QF tick processing */

    QF_INT_LOCK(ignore);                           /* lock interrupts again */
    /* send the EOI instruction to the Interrupt Controller */
}

/* case 2: Interrupt Controller not used,
* "saving and restoring interrupt status" critical section policy
* (nesting of critical sections allowed)
*/
interrupt void ISR_timer() {
    QF_tick();                            /*<-- call the QF tick processing */
}

Definition at line 40 of file qf_tick.c.

References QTimeEvt::act, QTimeEvt::ctr, QTimeEvt::interval, QTimeEvt::next, QTimeEvt::prev, QActive_postFIFO(), QF_timeEvtListHead_, QS_BEGIN_NOLOCK_, QS_END_NOLOCK_, QS_OBJ_, QS_QF_TICK, QS_QF_TIMEEVT_AUTO_DISARM, QS_QF_TIMEEVT_POST, QS_SIG_, QS_teObj_, QS_tickCtr_, QEvent::sig, and QTimeEvt::super.

Generated on Tue Mar 16 19:38:11 2010 for QP/C by  doxygen 1.6.3