====== OSA : OS_Dtimer_Delay ======
<color blue>**OS_Dtimer_Delay (dtimer, delay)**</color>\\ 
=== ===

{{osa:ref:attr_call_task.png|Allowed only in task}}{{osa:ref:attr_call_ct_sw.png|Switches context}}

Delay current task using dynamic timer.

##[[en:osa:ref:appendix:configuration#Timer control|OS_ENABLE_DTIMERS]]## constant must be defined in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##. Size of dynamic timers is set by ##[[en:osa:ref:appendix:configuration#Data types|OS_DTIMER_SIZE]]## constant

=== Call allowed: ===
Only in task


=== Parameters: ===
{| class = "fpl"
|-
|//''dtimer''//
|Descriptor of dynamic timer. Variable of ##[[en:osa:ref:description:data_types#OST_DTIMER|OST_DTIMER]]## type. Contains timer counter, timer state flags and pointer to next timer in list. For PIC16, can only be allocated in **bank0** or **bank1**
|-
|//''delay''//
|Time of delay. Set in system ticks - call ##[[en:osa:ref:allservices:OS_Timer|OS_Timer]]## periods
|}


=== Returns: ===
nothing

=== Example: ===
<code cpp>
OST_DTIMER dtimer;

void Task (void)
{
    OS_Dtimer_Create(dtimer);
    for (;;) {
        /*...*/
        OS_Dtimer_Delay (dtimer, 100);  // Delay task for 100 system ticks
        /*...*/
    }
}
</code>


=== Old style name ===
<color gray>**OS_DelayDTimer**</color>\\ 







=== See also ===
  * [[en:osa:ref:allservices:OS_Dtimer_Create|OS_Dtimer_Create]]
  * [[en:osa:ref:allservices:OS_Dtimer_Delete|OS_Dtimer_Delete]]

  * [[en:osa:ref:allservices:OS_Dtimer_Run|OS_Dtimer_Run]]
  * [[en:osa:ref:allservices:OS_Dtimer_Break|OS_Dtimer_Break]]
  * [[en:osa:ref:allservices:OS_Dtimer_Wait|OS_Dtimer_Wait]]
  * [[en:osa:ref:allservices:OS_Dtimer_Delay|OS_Dtimer_Delay]]

  * [[en:osa:ref:allservices:OS_Dtimer_Pause|OS_Dtimer_Pause]]
  * [[en:osa:ref:allservices:OS_Dtimer_Continue|OS_Dtimer_Continue]]
  * [[en:osa:ref:allservices:OS_Dtimer_Update|OS_Dtimer_Update]]
  * [[en:osa:ref:allservices:OS_Dtimer_Add|OS_Dtimer_Add]]
  * [[en:osa:ref:allservices:OS_Dtimer_IsActive|OS_Dtimer_IsActive]]
  * [[en:osa:ref:allservices:OS_Dtimer_IsStopped|OS_Dtimer_IsStopped]]

  * [[en:osa:ref:allservices:OS_Dtimer_Get|OS_Dtimer_Get]]
  * [[en:osa:ref:allservices:OS_Dtimer_Check|OS_Dtimer_Check]]
  * [[en:osa:ref:allservices:OS_Dtimer_IsRun|OS_Dtimer_IsRun]]


----
  * [[en:osa:ref:services:alphabetical|Alphabetical]]
  * [[en:osa:ref:services:brieflist|All services]]
~~UP~~