From 600e6ec2ae3a316922fb3fdf2e9355d7824033ee Mon Sep 17 00:00:00 2001 From: dylad Date: Wed, 19 Apr 2017 12:43:09 +0200 Subject: [PATCH] saml21/gpio: Allow multiple EXTI at the same time Signed-off-by: dylad --- cpu/saml21/periph/gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpu/saml21/periph/gpio.c b/cpu/saml21/periph/gpio.c index eb2268375f41..2807f52f4a14 100644 --- a/cpu/saml21/periph/gpio.c +++ b/cpu/saml21/periph/gpio.c @@ -137,6 +137,9 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank, /* enable clocks for the EIC module */ MCLK->APBAMASK.reg |= MCLK_APBAMASK_EIC; GCLK->PCHCTRL[EIC_GCLK_ID].reg = GCLK_PCHCTRL_CHEN | GCLK_PCHCTRL_GEN_GCLK0; + /* disable the EIC module*/ + EIC->CTRLA.reg = 0; + while (EIC->SYNCBUSY.reg & EIC_SYNCBUSY_ENABLE) {} /* configure the active flank */ EIC->CONFIG[exti >> 3].reg &= ~(0xf << ((exti & 0x7) * 4)); EIC->CONFIG[exti >> 3].reg |= (flank << ((exti & 0x7) * 4));