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

os_tsk_prio in interrupt rutine

Hello!

I was wandering, is it safe to call os_tsk_prio()inside a interrupt rutine? Are any os_ functions safe to call from interrupts or are only isr_ functions allowed?

Thanks for your answers.

  • The official information is that only the functions with isr_ names may be called.

    Why would you want to change any priority in the ISR? Normal is to have a high-prio thread sleeping until the ISR signals that there are work to do. Then the sleeping thread will activate and win over lower-prio threads.

    Did you intend to have the same thread perform both low-prio and high-prio jobs? Thats normally not a good idea - if it is already busy with low-prio work, then it needs to finish that work before it spots that there are high-prio jobs to perform. You get better response times with separate tasks for different priorities.

  • Ye I wanted to use an existing task, however thank you for reminding me the problems I would get. I will use a separate task. I remember reading that only isr_ functions can be called in interrupts, but I couldn't find the source, so thank you :)