_OST_TTIMER OS_Ttimer_Get ()
Get task timer's remaining time. Before calling this service you should to do one of these things:
Otherwise the timer's value can be changed in interrupt while reading.
To use task timers you need to define OS_ENABLE_TTIMERS in OSAcfg.h. Size of current task's timers is set by OS_TTIMER_SIZE constant
Allowed only in task and functions called by task (any depth)
no
_OST_TTIMER |
integer value of remaining time (in system ticks) |
void Task (void) { for (;;) { /*...*/ OS_DI(); if (OS_Ttimer_Get () < 10) // Flash red led if RED_LED = 1; // less than 10 ticks remains OS_EI(); /*...*/ } }