From c1d7a4c06cf440acd7298971183db765fcde95df Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Wed, 27 Apr 2016 00:56:47 +0200 Subject: [PATCH] Fix setup on interupts on GPIO --- drivers/gpio.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.43.0