The CHANGE implementation used the wrong logic (using gpioMode instead of irqMode to switch the interrupt edge).
It also changes the edge after calling the isr instead of before (to avoid signal changes while servicing the isr, though that would be bad anyway).
It also sets the initial edge based on the current level of the pin.
The CHANGE implementation used the wrong logic (using gpioMode instead of irqMode to switch the interrupt edge). It also changes the edge after calling the isr instead of before (to avoid signal changes while servicing the isr, though that would be bad anyway). It also sets the initial edge based on the current level of the pin.