====== OSA : OS_Bsem_Wait ======
**OS_Bsem_Wait (bsem)**\\
=== ===
{{osa:ref:attr_call_task.png|Allowed only in task}}{{osa:ref:attr_call_ct_sw.png|Switches context}}
Wait for binary semaphore.
=== Call allowed: ===
Only in task
=== Parameters: ===
{| class = "fpl"
|-
|//''bsem''//
|Binary semaphore's ID. Number of binary semaphores is set by ##[[en:osa:ref:appendix:configuration#Data contents|OS_BSEMS]]## constant in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##
|}
=== Returns: ===
nothing
=== Example: ===
void Task (void)
{
for (;;) {
/*...*/
OS_Bsem_Wait(5); // Wait for binary semaphore #5
/*...*/
}
}
=== Old style name ===
**OS_WaitBSem**\\
=== See also ===
* [[en:osa:ref:allservices:OS_Bsem_Set|OS_Bsem_Set]]
* [[en:osa:ref:allservices:OS_Bsem_Reset|OS_Bsem_Reset]]
* [[en:osa:ref:allservices:OS_Bsem_Check|OS_Bsem_Check]]
* [[en:osa:ref:allservices:OS_Bsem_Switch|OS_Bsem_Switch]]
* [[en:osa:ref:allservices:OS_Bsem_Wait_TO|OS_Bsem_Wait_TO]]
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|All services]]
~~UP~~