This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

bar or plus symbol for os_wait events?

Hi folks

The function reference page for RTX tiny os_wait() is slightly confusing.
(http://www.keil.com/support/man/docs/tr51/tr51_os_wait.htm)

It specifies using the bar operator to OR events, but in the example it uses a + symbol.
All other examples of os_wait also use the + operator.

Is there any difference? which one is more correct?

Thanks

PS: Also Im not new, just haven't posted in a really long time but I dont see any login gate for this forum...am I blind?

Parents
  • event = os_wait (K_SIG + K_TMO, 50, 0);
    

    A '+' is not the same as '|'. However, if K_SIG and K_TMO are bitwise values, a '+' and a '|' will have the same result in this instance.

    Even though using a '+' instead of a '|' has the same result, I think it's bad form. The intention is *not* addition, it's bitwise OR.

Reply
  • event = os_wait (K_SIG + K_TMO, 50, 0);
    

    A '+' is not the same as '|'. However, if K_SIG and K_TMO are bitwise values, a '+' and a '|' will have the same result in this instance.

    Even though using a '+' instead of a '|' has the same result, I think it's bad form. The intention is *not* addition, it's bitwise OR.

Children