2020-03-19 12:10 PM
I have an EXTI interrupt with a shared handler, EXTI15_10_IRQHandler
Normally there should be only pin 15 interrupt.
So I did this:
void EXTI15_10_IRQHandler(void)
{
if ((EXTI_D1->PR1 & (1<<15)) != 0)
{
my_handler();
EXTI_D1->PR1 = (1 << 15);
__DSB();
return;
}
__BKPT(1); //unexpected interrupt
}
And sometimes I hit the breakpoint.
Looks like the EXTI_D1->PR1 corresponds to EXTI_CPUPR1 in the RM.
In debugger, bit 15 of EXTI_CPUPR1 is indeed clear.
So the question is, do EXTI_CPUPR1 bits stay on until cleared by software or they can auto-clear when the GPIO pin changes state?
-- pa
2020-03-23 02:52 AM
Moving EXTI_CLEAR_IT() up and __ISB() seems to help.
Thanks.
-- pa