_OST_QTIMER OS_Qtimer_Get (qtimer)
Get timer's remaining time. Before calling this service you should do one of these things:
Otherwise the timer's value can be changed in the interrupt while reading.
OS_ENABLE_QTIMERS constant must be defined in OSAcfg.h. Size of timers is set by OS_QTIMER_SIZE constant
Not in interrupt
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 |
_OST_QTIMER |
integer value of remaining time (in system ticks) |
OST_QTIMER qtimer; void Task (void) { char itemp; for (;;) { /*...*/ itemp = OS_DI(); if (OS_Qtimer_Get(qtimer) < 10) // Flash green led if less than GREEN_LED = 1; // ten ticks remain OS_RI(itemp); /*...*/ } }