drivers: gpio: rv32m1: fix interrupt clear

In order to reliably detect interrupts the interrupt must be
acknowledged before the callback is invoked.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-10-30 06:20:48 -05:00 committed by Carles Cufí
parent ff4294a7fe
commit 8c8f8bbb48

View file

@ -348,10 +348,11 @@ static void gpio_rv32m1_port_isr(void *arg)
int_status = config->port_base->ISFR;
enabled_int = int_status & data->pin_callback_enables;
/* Clear the port interrupts before invoking callbacks */
config->port_base->ISFR = enabled_int;
gpio_fire_callbacks(&data->callbacks, dev, enabled_int);
/* Clear the port interrupts */
config->port_base->ISFR = enabled_int;
}
static int gpio_rv32m1_init(struct device *dev)