====== OSA : OS_Bsem_Switch ======
**OS_Bsem_Switch (bsem)**\\
**OS_Bsem_Switch_I (bsem)**\\
=== ===
Switches binary semaphore to other state ("0"->"1" or "1"->"0").
=== Call allowed: ===
Everywhere
=== 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_Switch(3); // Change state of binary semaphore #3
/*...*/
}
}
=== Old style name ===
=== See also ===
* [[en:osa:ref:allservices:OS_Bsem_Check|OS_Bsem_Check]]
* [[en:osa:ref:allservices:OS_Bsem_Reset|OS_Bsem_Reset]]
* [[en:osa:ref:allservices:OS_Bsem_Set|OS_Bsem_Set]]
* [[en:osa:ref:allservices:OS_Bsem_Wait|OS_Bsem_Wait]]
* [[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~~