This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use restricted interrupt priority levels

Is there any reason I can't have the radio notification run at priority 0? By definition it will never run at the same time as the lower stack, so it seems like I should be able to make it high priority.

By the same token, is there a reason I can't use priority 2? I can use priority 1, meaning I'm allowed to interrupt the upper stack—any reason I can't just use priority 2 as well?

Alternatively, is there any way I can make one interrupt (e.g. SWI1) take priority over another (e.g. ADC) if both interrupts want to run?

Parents
  • Hi,

    The SoftDevice needs to be able to interrupt the radio notification in order to start radio activity, this is why it has restricted access to priority 0. Likewise the SoftDevice needs priority 2 so that it is able to deal with its less time critical tasks. If you want to be able to run freely of the SoftDevice for a period, schedule a timeslot.

    In general the interrupt that is triggered first is the one that is handled first, a higher priority interrupt will interrupt a lower priority interrupt. If you have two equal priority interrupts firing at the same time, the one with the lowest ISR number will be handled first.

    Best regards,

    Øyvind

Reply
  • Hi,

    The SoftDevice needs to be able to interrupt the radio notification in order to start radio activity, this is why it has restricted access to priority 0. Likewise the SoftDevice needs priority 2 so that it is able to deal with its less time critical tasks. If you want to be able to run freely of the SoftDevice for a period, schedule a timeslot.

    In general the interrupt that is triggered first is the one that is handled first, a higher priority interrupt will interrupt a lower priority interrupt. If you have two equal priority interrupts firing at the same time, the one with the lowest ISR number will be handled first.

    Best regards,

    Øyvind

Children
Related