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.

TivaWare ROM_TimerIntClear question

In the TIVA ROM datasheet for the ROM_TimerIntClear() method, it states:

"Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted)."

If I call ROM_TimerIntClear() in my ISR, and the timer expires again.  Will the ISR be entered again while i'm still in the ISR, or will it wait until the ISR has completed before servicing the ISR again?

Thanks

  • Hello Aaron,

    Depends. If the timer expires again before the ROM_TimerIntClear is executed in the ISR, it will get cleared and ISR will not be executed. If the timer expires after the clear operation while CPU is still in the ISR, then it will complete the ISR, exit and then immediately re-enter if there is no other higher priority interrupt.

    Regards
    Amit
  • Okay, so if I understand correctly, I won't get myself into a "recursion" problem if I call ROM_TimerIntClear early in the interrupt?

    I don't use much stack space; however, I wouldn't want the same ISR to be called multiple times if it is slowed down (due to a higher priority interrupt being serviced) and end up with a bunch of information on the stack because the ISR is being called within the ISR.
  • Hello Aaron,

    No. The recursion problem will not occur.

    Regards
    Amit