libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
419 stars 62 forks source link

[beken-72xx] Fix CHANGE interrupt logic #290

Closed olivluca closed 2 months ago

olivluca commented 3 months ago

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.