This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Handling multiple interrupts

hello,

if a launchpad is serving one interrupt and during that time if an another interrupt with higher interrupt priority occurs, which of the following will happen..

  • will it continue to serve the previous interrupt.?
  • or will it first serve the higher priority interrupt first and return back to previous interrupt routine.?
  • See the User's Guide.

    The priority matters only at the moment of granting an interrupt. If more than one interrupts are pending, only the one with the highest priority at that moment is granted.  Once granted, further interrupts (even with higher priority) will not be granted until  the current interrupt service routine executes either (a) "return from interrupt" or (b) "enable interrupt". 

  • old_cow_yellow said:
    or (b) "enable interrupt"

    It should be added that enabling interrupts inside an ISR is called 'interrupt nesting' and can cause all sorts of problems.

    If an interrupt is pending, the current ISR won't finish until there are no more interrupts to handle. It will lead to increased usage of stack space and may even lead to the very same ISR being entered again before its first call was exited. Especially if the cause for the call of the current ISR wasn't removed, this will enter an endless interrupt loop, instantly causing a stack overflow and a crash.

    Also, interrupt nesting is only required in very, very rare cases and should only be used by very experienced persons.
    In 99.99% of all cases, just exit the current ISR to have the next one handled.

**Attention** This is a public forum