====== OSA : OS_Timer ======
**OS_Timer ()**\\
=== ===
{{osa:ref:attr_call_to.png|Uses timer}}
Use with all timers.
This service must be used if:
* any task uses ##[[en:osa:ref:allservices:OS_Delay|OS_Delay]]##();
* any task waits for events with timeout;
* static or dynamic timers are used in the program.
This service should be called from a regularly-called place in the program (e.g. a timer interrupt routine).
In this documentation we use the term __**system tick**__ for the period between calls to ##[[en:osa:ref:allservices:OS_Timer|OS_Timer]]##. All delays and timeout parameters in services are given in **system ticks**.
At every execution of ##[[en:osa:ref:allservices:OS_Timer|OS_Timer]]##() all active timers are increased by 1 (except 24-bit old style static timers which are increased by 1 every 256 calls).
=== Call allowed: ===
Everywhere
=== Parameters: ===
None
=== Returns: ===
nothing
=== Example: ===
void interrupt isr (void)
{
if (TMR2IF) {
TMR2IF = 0;
OS_Timer ();
/*...*/
}
}
=== See also ===
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|All services]]
~~UP~~