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

My idea about ARTX isr_evt_set()

In the ARTX help say 'It might happen that two isr_evt_set() functions for the same task are called before the task gets a chance to run from os_evt_wait_xx() event waiting function. Of course one event is lost because event flags are not counting objects.' I think if two isr_evt_set() functions should be called, we can set the different bit of the event_flags, then no event will be lost. I mean the isr_evt_set() functions just OR the event_flags but not cover with the event_flags. My idea is right?

Parents
  • Interrupts are in general not predictable. So you never know when an interrupt will happen. If you have a task which need to react on every event received from an interrupt function, then Kernel events are not a good means of doing this.

    This is because two (or more) interrupts might happen sequentially one after another before the task gets a chance to run. isr_evet_set() function just OR the event flags. Event flags are cleared when os_evt_wait_xx() function resumes it's execution. This is done by the Kernel itself.

    You should use semaphores instead. Each isr_sem_send() function call will increment number of tokens from a semaphore. In this way, no events are lost. Semaphore objects are counting objects comparing to Kernel event flags, which are not.

    Franc

Reply
  • Interrupts are in general not predictable. So you never know when an interrupt will happen. If you have a task which need to react on every event received from an interrupt function, then Kernel events are not a good means of doing this.

    This is because two (or more) interrupts might happen sequentially one after another before the task gets a chance to run. isr_evet_set() function just OR the event flags. Event flags are cleared when os_evt_wait_xx() function resumes it's execution. This is done by the Kernel itself.

    You should use semaphores instead. Each isr_sem_send() function call will increment number of tokens from a semaphore. In this way, no events are lost. Semaphore objects are counting objects comparing to Kernel event flags, which are not.

    Franc

Children
No data