Skip to main content
arnold_w
Senior II
August 15, 2017
Question

Find out if interrupt has occurred?

  • August 15, 2017
  • 1 reply
  • 609 views
Posted on August 15, 2017 at 10:03

I am working with the stm32f4 Discovery Development Board and put simply, there's a while loop (with some conditions) in my main() function. Is it possible for the code inside the while-loop to find out it has been interrupted by an interrupt? Of course, I can use a global volatile boolean variable called intOccurred and set it to true in all interrupt handlers, but is there a more generic way to detect it?

    This topic has been closed for replies.

    1 reply

    waclawek.jan
    Super User
    August 15, 2017
    Posted on August 15, 2017 at 13:23

    No.

    Execution of ISR clears the pending flag (NVIC_ISPRx) by hardware - otherwise the ISR would be executed again and again...

    JW