Pages: [1]   Go Down
Author Topic: How to reset Due´s pending Interrupts  (Read 1064 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

For debouncing a button connected to an interrupt I used the following procedure in the past:
disable the Interupt in its associated routine
and start a timer to match in a few milliseconds
in timer´s routine delete the flag in EIFR
and re enable the interrupt.

Now Im using the Due with the new core and tried the following to delete the pending flag:

NVIC_ClearPendingIRQ(PIOC_IRQn);
and / or
Pio* pPio = PIOA;
uint32_t dwReg = pPio->PIO_ISR;

but every time i do attachInterrupt(45, Menu_Button, FALLING); after that
the routine starts immediately.

I would be happy about every hint.
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 16
Posts: 512
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello aSchindler,
I noticed you're clearing PIOC and enabling PIOA. What's your button's PIO? Regards!
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

why not directly use the hardware debounce filter of the DUE?

http://forum.arduino.cc/index.php?topic=156474.0
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

@Palliser
Sorry abut confusion I use 3 Buttons and posted the code from different ones.

@Schwingkopf
It is working!!! Thanks for this sugestion.

My problem is solved but just for curiosity because i spend so many hours for searching the pending flag. How can I reset pending Interrupts?

Thank you guys.
Logged

Pages: [1]   Go Up
Jump to: