drivers: gpio_mcux: Fix interrupt handling
Change when we clear interrupt status to happen before we handle the callbacks. As the callbacks might manipluate the GPIO state and cause a GPIO interrupt. If we clear interrupt status after than we might miss an interrupt. Also only clear interrupts for interrupts that are we have enabled and that were reported when we read from the interrupt status. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
951f91071a
commit
7989f5cd6b
1 changed files with 3 additions and 3 deletions
|
@ -348,10 +348,10 @@ static void gpio_mcux_port_isr(void *arg)
|
|||
int_status = config->port_base->ISFR;
|
||||
enabled_int = int_status & data->pin_callback_enables;
|
||||
|
||||
gpio_fire_callbacks(&data->callbacks, dev, enabled_int);
|
||||
|
||||
/* Clear the port interrupts */
|
||||
config->port_base->ISFR = 0xFFFFFFFF;
|
||||
config->port_base->ISFR = enabled_int;
|
||||
|
||||
gpio_fire_callbacks(&data->callbacks, dev, enabled_int);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue