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

Wait for message and signal simultaneously using CMSIS RTX call


Wait for message and signal simultaneously using CMSIS RTX call

Hi All,

I am using CMSIS RTX V4.80.0. I need to wait for a message and a signal simultaneously in a single thread.

In the CMSIS RTOS API, I came across a function osWait() which meets my requirement. Is there any methods to achieve the same using the CMSIS RTX API.

In CMSIS RTX, both the osSignalWait and the osMessageGet functions return the same structure an osEvent which contains osStatus that contains the information for unblock(an osEventSignal or an osEventMessage). I tried using osSignalWait/osMessageGet function in the thread and identify whether message or signal is received using the return status. But for osSignalWait only osEventSignal is received as status and for osMessageGet only osEventMessage is received as status.

Is there any other alternatives to meet the requirement.

Thank you.

Parents
  • Note that you can implement an arbitrarily complex "wait for multiple" with some own code.

    Implement code where you in a critical section change one or more of your n state variables. Then evaluate your wakeup condition - if it is satisfied then signal this using a "summary" event.

    So an interested thread waits for this "summary" event. When the thread wakes up, it enters a critical section to decide if it wants to reset one or more of all your individual state variables.

Reply
  • Note that you can implement an arbitrarily complex "wait for multiple" with some own code.

    Implement code where you in a critical section change one or more of your n state variables. Then evaluate your wakeup condition - if it is satisfied then signal this using a "summary" event.

    So an interested thread waits for this "summary" event. When the thread wakes up, it enters a critical section to decide if it wants to reset one or more of all your individual state variables.

Children