[riot-notifications] [RIOT-OS/RIOT] cpu/saml1x: add support for SAML10 and SAML11 MCUs (Cortex-M23) (#10653)

Alexandre Abadie notifications at github.com
Mon Jan 21 13:18:50 CET 2019


aabadie commented on this pull request.



> @@ -220,17 +239,70 @@ void gpio_irq_disable(gpio_t pin)
     if (exti == -1) {
         return;
     }
-    EIC->INTENCLR.reg = (1 << exti);
+    _EIC->INTENCLR.reg = (1 << exti);
+}
+
+#ifdef CPU_SAML1X
+void isr_eic0(void)

I would do this differently do avoid all this code duplication:

```c
#ifdef CPU_SAML1X
void isr_eic0(void)
{
    isr_eic()
}
...
void isr_eic1(void)
{
    isr_eic()
}

void isr_eic_other(void)
{
    isr_eic()
}
#endif /* SAML1X */

void isr_eic(void)
{
    for (unsigned i = 0; i < NUMOF_IRQS; i++) {
        if (_EIC->INTFLAG.reg & (1 << i)) {
            _EIC->INTFLAG.reg = (1 << i);
            gpio_config[i].cb(gpio_config[i].arg);
        }
    }
    cortexm_isr_end();
}
```

This is untested but I think it should work.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10653#pullrequestreview-194573565
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190121/1ef272f1/attachment-0001.html>


More information about the notifications mailing list