Which Pin is triggering an interrupt How do I count them not multiple time?
Hello everybody,
how can I count which pin triggers an interrupt, but not multiple times? I have written the following ISR.
INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4)
{
data = (uint8_t)GPIOB->IDR& 0xF;
if((GPIO_PIN_0 & data )== GPIO_PIN_0) {
counter_Pin0++;
}
if((GPIO_PIN_1 & data )== GPIO_PIN_1) {
counter_Pin1++;
}
}I first store the first four bits from GPIOB port in data and then I mask the bit form the pin. But as you can see in the picture, it is also counted when Pin 1 triggers an interrupt. The sensors have a small delay to each other, but are LOW for a certain time. I actually have 4 sensors, each of which are sometimes LOW at the same time, but trigger an interrupt at different times. Then I do not count 4 interrupts at Pin0 but 11 for example.
Best Regards
Michael
