OS_WakeTask( ) Question

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

  • OS_WakeTask( ) Question

    I have an interrupt service routine that gets data, places it into memory, then sends a message to an associated task that the data is ready. I recently found that I could also use OS_WakeTask( ) to immediately have that task process the data. At the end of that task, I have a OS_Delay( ) - do I really need the delay any more, if the task can be awakened directly by its associated interrupt service routine?



    When I commented out the OS_Delay, I found that a task that blinks an LED (to let me know that the OS is working) - stopped, until I raised the priority to match the task using OS_WakeTask( ).



    Hopefully, I have made this clear...



    I could keep the OS_Delay in the task code, just put a huge delay - have not tried that yet. What was confusing was why the LED task essentially stopped...



    Regards,

    Todd Anderson
  • Task Event vs. OS_WakeTask( )

    Further exploration - looks like I could use a "task event" to signal a task from an interrupt service routine... more than one way to do this?



    Thanks...



    By the way, I am using an MSP430F5xxx part, IAR Tools, and embOS for MSP430.



    Todd Anderson
  • Hello Todd,


    Hopefully, I have made this clear...

    No, unfortunately not ;). But I guess I know what you want to do.

    You have an interrupt routine which generates data and a task which works with that data. This could be e.g. an uart interrupt routine which gets serial data from the uart and wants to send this data to a task.
    With embOS there are more than one solution for this. You could signal a task with Task Events that there is new data. But the easiest solution is to use a Mailbox or Queue.
    The task listen to the mailbox is suspended as long as there is no new data. The interrupt routine only has to store the new data in the mailbox.

    Does this solve your problem?

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • OS_WakeTask( ) Question

    Til:

    Thanks - I have a situation that is exactly as you described, and it appears that the Task Event strategy appears to be the best way to tackle it so far. In my case, I have a task that is waiting on data before it does anything. That data is generated via interrupt service routine, and using the task event, I can essentially wake up the task rather quickly without having to write to a mailbox and use OS_WakeTask( ).



    There are other tasks that I will be using the OS_WakeTask( ) function, so it is nice to see that it is available.



    Regards,

    Todd Anderson :)