From: Nathael Pajani Date: Tue, 26 Apr 2016 22:56:47 +0000 (+0200) Subject: Fix setup on interupts on GPIO X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=c1d7a4c06cf440acd7298971183db765fcde95df;p=soft%2Flpc122x%2Fcore Fix setup on interupts on GPIO --- diff --git a/drivers/gpio.c b/drivers/gpio.c index be02053..0773efb 100644 --- a/drivers/gpio.c +++ b/drivers/gpio.c @@ -145,6 +145,9 @@ int set_gpio_callback(void (*callback) (uint32_t), const struct pio* gpio, uint8 default: /* Not handled, do not activate the interrupt */ return -EINVAL; } + /* Clear edge detection logic */ + gpio_port->int_clear |= (1 << gpio->pin); + /* Enable interrupt */ gpio_port->int_enable |= (1 << gpio->pin); NVIC_EnableIRQ(irq); return 0;