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

RTX and events?

Hello! I have question about os_evt_wait_or() and os_evt_wait_and(). I was reading about theoretical differents between this functions, but in practice doesn't work like i thought.

Can you give me a simple example how to use os_evt_wait_and()?

Thanks

Parents
  • os_evt_wait with AND FALSE waits for all the "events" to be set before it will return.

    os_evt_wait( 0x05, timeout, TRUE );
    or use the MACRO os_evt_wait_and(0x05, timeout);

    the program will wait until some task(s) calls

    os_set_evt( 0x01, waitingTasksTID); AND
    os_set_evt( 0x04, waitingTasksTID);

    os_evt_wait with AND FALSE waits for any "event" to be set to return

    os_evt_wait( 0x05, timeout, FALSE);
    os use MACRO os_evt_wait_or( 0x05, timeout);

    the program will wait until some task calls

    os_set_evt( 0x01, waitingTasksTID); OR
    os_set_evt( 0x04, waitingTasksTId);

    It will not wait for both to be called.

Reply
  • os_evt_wait with AND FALSE waits for all the "events" to be set before it will return.

    os_evt_wait( 0x05, timeout, TRUE );
    or use the MACRO os_evt_wait_and(0x05, timeout);

    the program will wait until some task(s) calls

    os_set_evt( 0x01, waitingTasksTID); AND
    os_set_evt( 0x04, waitingTasksTID);

    os_evt_wait with AND FALSE waits for any "event" to be set to return

    os_evt_wait( 0x05, timeout, FALSE);
    os use MACRO os_evt_wait_or( 0x05, timeout);

    the program will wait until some task calls

    os_set_evt( 0x01, waitingTasksTID); OR
    os_set_evt( 0x04, waitingTasksTId);

    It will not wait for both to be called.

Children