====== OSA : OS_Stimer_Get ======
**_OST_STIMER OS_Stimer_Get (stimer_id)**\\
=== ===
Get static timer's remaining time. Before calling this service you should to do one of these things:
* disable interrupts
* enter critical section
Otherwise the timer's value can be changed in interrupt while reading.
Number of static timers ##[[en:osa:ref:appendix:configuration#Timer control|OS_STIMERS]]## (1..32) must be specified in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. Size of static timers is set by ##[[en:osa:ref:appendix:configuration#Data types|OS_STIMER_SIZE]]## constant
=== Call allowed: ===
Everywhere
=== Parameters: ===
{| class = "fpl"
|-
|//''stimer_id''//
|##[[en:osa:ref:services:timers#Static timers|Static timer]]## identifier. Number and size of static timers are set in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]## with ##[[en:osa:ref:appendix:configuration#Timer control|OS_STIMERS]]## and ##[[en:osa:ref:appendix:configuration#Data types|OS_STIMER_SIZE]]## constants
|}
=== Returns: ===
{| class = "fpl"
|-
|//''[[en:osa:ref:description:data_types#_OST_STIMER|_OST_STIMER]]''//
| integer value of remaining time (in system ticks)
|}
=== Example: ===
void Task (void)
{
for (;;) {
/*...*/
OS_DI();
if (OS_Stimer_Get (3) < 10) // Flash red led if
RED_LED = 1; // less than 10 ticks remains
OS_EI();
/*...*/
}
}
=== Old style name ===
**OS_GetSTimer**\\
=== See also ===
* [[en:osa:ref:allservices:OS_Stimer_Alloc|OS_Stimer_Alloc]]
* [[en:osa:ref:allservices:OS_Stimer_Free|OS_Stimer_Free]]
* [[en:osa:ref:allservices:OS_Stimer_Found|OS_Stimer_Found]]
* [[en:osa:ref:allservices:OS_Stimer_Run|OS_Stimer_Run]]
* [[en:osa:ref:allservices:OS_Stimer_Break|OS_Stimer_Break]]
* [[en:osa:ref:allservices:OS_Stimer_Wait|OS_Stimer_Wait]]
* [[en:osa:ref:allservices:OS_Stimer_Delay|OS_Stimer_Delay]]
* [[en:osa:ref:allservices:OS_Stimer_Get|OS_Stimer_Get]]
* [[en:osa:ref:allservices:OS_Stimer_Check|OS_Stimer_Check]]
* [[en:osa:ref:allservices:OS_Stimer_IsRun|OS_Stimer_IsRun]]
* [[en:osa:ref:allservices:OS_Stimer_Pause|OS_Stimer_Pause]]
* [[en:osa:ref:allservices:OS_Stimer_Continue|OS_Stimer_Continue]]
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|All services]]
~~UP~~