This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Setting interrupt priority levels

Hi, the specification of nRF5 SDK for Mesh v5.0.0. says the interrupt priority has two levels, named priority_lowest and priority_thread.  

I am not clear on some things.

Number1:  Does the interrupt operation wait for a period of time? If does, what's the waiting time? Can if setting the waiting time? Does it have a range?

Number2: What's the difference between the two levels?  Are they having the same functions?

Parents
  • Hi, 

    Number1:  Does the interrupt operation wait for a period of time? If does, what's the waiting time? Can if setting the waiting time? Does it have a range?

    It's hard to answer this answer. It will wait for other high-priority tasks to finish the jobs.  

    Number2: What's the difference between the two levels?  Are they having the same functions?

    If you have a look here, you can find that if you call mesh_init() with NRF_MESH_IRQ_PRIORITY_LOWEST , then you would need to call mesh APIs from the interrupt handler at NRF_MESH_IRQ_PRIORITY_LOWEST level. You can't call Mesh API in the main loop. 
    Otherwise you need to initialize mesh with NRF_MESH_IRQ_PRIORITY_THREAD then you should not call Mesh APIs in an interrupt handler. 

    If you want to call mesh API in both contexts, you would need to either use a software interrupt and call the interrupt from the main loop when you use NRF_MESH_IRQ_PRIORITY_LOWEST  , or the opposite, use app_scheduler if you use NRF_MESH_IRQ_PRIORITY_THREAD .

    -Amanda H. 

Reply
  • Hi, 

    Number1:  Does the interrupt operation wait for a period of time? If does, what's the waiting time? Can if setting the waiting time? Does it have a range?

    It's hard to answer this answer. It will wait for other high-priority tasks to finish the jobs.  

    Number2: What's the difference between the two levels?  Are they having the same functions?

    If you have a look here, you can find that if you call mesh_init() with NRF_MESH_IRQ_PRIORITY_LOWEST , then you would need to call mesh APIs from the interrupt handler at NRF_MESH_IRQ_PRIORITY_LOWEST level. You can't call Mesh API in the main loop. 
    Otherwise you need to initialize mesh with NRF_MESH_IRQ_PRIORITY_THREAD then you should not call Mesh APIs in an interrupt handler. 

    If you want to call mesh API in both contexts, you would need to either use a software interrupt and call the interrupt from the main loop when you use NRF_MESH_IRQ_PRIORITY_LOWEST  , or the opposite, use app_scheduler if you use NRF_MESH_IRQ_PRIORITY_THREAD .

    -Amanda H. 

Children
No Data
Related