lost Interrupts for MKRZero using Change for Interrupt

Hi,
I have a Push Button with pullup connected to digital in pin. I'm reading from digital Pin having attached an IRQ routing with
attachInterrupt(digitalPinToInterrupt(pin), IRQ_ForPin, CHANGE)
In the Interrupt routing I read the value of the pin
value = DigitalReal(pin)

My problem is, that sometimes the value read is not the value of the pin.

Looking at the IRQ handling shows, that IRQ routing is called before interrupt is cleared. So pin may change after I read and before IRQ is cleared. Thats seems to be my problem. This can be fixed, by clearing IRQ after call attached function.

After doing this change, this issue is gone:

From WInterrupts.c:
void EIC_Handler(void)
{
[...]
{
if ((EIC->INTFLAG.reg & ISRlist*) != 0)*

  • {*
  • // interted here*
  • // Clear the interrupt*
    _ EIC->INTFLAG.reg = ISRlist*;_
    _
    // Call the callback function*_
    _ ISRcallback*();
    // commented out here*
    * // Clear the interrupt*
    // EIC->INTFLAG.reg = ISRlist*;
    }
    }
    }*

    I assume, that a bug. How can I get this fix into the official version Arduino for MKRZero?
    Thanks and best regards
    Achim_

You would normally write up the issue on GITHUB but place it in the relevant repository.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

I have added this as bug in GitHub, Thanks for the link. (First time GitHub for me :-))

best regards
Achim