OSA : OS_Qtimer_Run

OS_Qtimer_Run (qtimer, newtime)

Not allowed in interrupt

Add timer qtimer to queue and start counting it for time newtime. Timeout flag is cleared.

OS_ENABLE_QTIMERS constant must be defined in OSAcfg.h. Size of timers is set by OS_QTIMER_SIZE constant

Call allowed:

Not in interrupt

Parameters:

qtimer Descriptor of timer. Variable of OST_QTIMER type. Contains timer counter, timer state flags and pointer to next timer in list. For PIC16, can only be allocated in bank0 or bank1
newtime Value to set timer's counter. Sets in system ticks - call OS_Timer periods. Size of time value must be less than size of timer

Returns:

nothing

Example:

OST_QTIMER qtimer;
 
void Task (void)
{
    OS_Qtimer_Create(qtimer);
    for (;;) {
        /*...*/
        OS_Qtimer_Run (qtimer, 100); // Run qtimer for 100 ticks
        /*...*/
    }
}

See also