Go Down

Topic: How to reset Due´s pending Interrupts (Read 1 time) previous topic - next topic

aSchindler

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.

Palliser

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

schwingkopf


aSchindler

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.

Go Up