Go Down

Topic: Due Interrupt flag clearing (I think!) (Read 169 times) previous topic - next topic



So, I have a 4x4 button Matrix, with a FALLING interrupt set on each of the column pins.  When the ISR fires, it:
  •     disables the interrupts
  •     performs a full key-scan of the matrix
  •     puts any necessary objects on a queue for subsequent processing elsewhere in the code
  •     re-enables the interrupts.

My problem is, I need the program to carry on processing for the duration of the button press, however, it isn't.  Having investigated, I believe this to be because the key-scan of the matrix is activating the FALLING trigger again, setting the interrupt pending flag, which then gets immediately picked up when the interrupts are re-enabled at the end of the ISR, consequently the ISR is called repeatedly locking up the processor until the button is released.

So, how do I clear the interrupt pending flags on the Due.  I have seen various examples for the other chip based Arduino cards, but this seems illusive.  Can anyone help?!

Many thanks, Chris.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131