Event Usage in Embos

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Event Usage in Embos


    I am new to the RTOS world. I am using emBos RTOS.3.32 with AustriMicroSystems chip and currently have a question regarding the usage of the event.

    According to your user manual, each task can have up to 8 different events. Based on my understanding, if I have n tasks, I should be able to generate 8n events. However, what bothers me is that OS_WaitEvent() does not specify which event for a particular task has been signaled. Here is an example to describe my questions:

    There are 4 tasks. Task1 has highest priority. Both Task1 and Task2 are waiting for an event to happen. The event mask is the same. Assume another function call OS_SignalEvent for the Task2 event1. My code is supposed to wake up CallAnother2() to perform some tasks. However, since CallAnother1() is waiting for the same event (is supposed to be from Task1) and has the higher priority, do you think your OS will wake up CallAnother1 first? If this is the case, it is not what I envisoned. And does that mean in any time, I cannot have more than 8 different events during the execution of my program?

    Please help me on this. Thanks
    • example.GIF

      20.35 kB, 703×954, viewed 839 times
  • Hi ADS,

    there are 2 types of Events in embOS:
    Task-specific events and Event objects, which are non-task specific.

    It sounds like in your case, using Event objects (see chapter 10 of the user manual) would
    be the right choice. embOS support an unlimited number of event objects (which need to be created
    using OS_EVENT_Create) and allows any number of tasks to wait for an event Object.

    Hope that helps!