[riot-notifications] [RIOT-OS/RIOT] cpu/nrf5x: handle multiple exti pins in gpio driver (#10828)

Leandro Lanzieri notifications at github.com
Tue Jan 22 13:40:14 CET 2019

leandrolanzieri commented on this pull request.

>  }
 void gpio_irq_disable(gpio_t pin)
-    (void) pin;
+    for (unsigned int i = 0; i < _gpiote_next_index; i++) {
+        if (_exti_pins[i] == pin) {
+            uint32_t inten = NRF_GPIOTE->INTENCLR;
+            inten &= ~(GPIOTE_INTENSET_IN0_Msk << i);
+            NRF_GPIOTE->INTENSET = inten;

> pressing a button with disabled interrupt was triggering the interrupt when re-enabling it. I fixed by clearing any pending interrupt when re-enabling. This is weird.

It seems that `INTENCLR` only disables interrupts from happening but not events from being registered. I changed that behavior by setting the `mode` bits of the `config` register to 'disabled', and setting them back to 'event' when re-enabling the irq.

I don't know if that is the correct way, in any case your solution only needs 1 line so I think that's fine.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190122/b8aeadbe/attachment.html>

More information about the notifications mailing list