Fix setup on interupts on GPIO
authorNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 26 Apr 2016 22:56:47 +0000 (00:56 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/gpio.c

index be02053..0773efb 100644 (file)
@@ -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;