STM32: Raise error in case of spurious interrupt

In case we've run through the entire GPIOs loop, withouth finding a
matching interrupt, we're in the case of a spurious interrupt, let's
raise an error to track it down.
pull/4676/head
Laurent MEUNIER 2017-06-30 09:52:45 +02:00
parent ade981dc9e
commit cea91306de
1 changed files with 4 additions and 1 deletions

View File

@ -90,8 +90,9 @@ static void handle_interrupt_in(uint32_t irq_index, uint32_t max_num_pin_line)
if (__HAL_GPIO_EXTI_GET_FLAG(pin) != RESET) {
__HAL_GPIO_EXTI_CLEAR_FLAG(pin);
if (gpio_channel->channel_ids[gpio_idx] == 0)
if (gpio_channel->channel_ids[gpio_idx] == 0) {
continue;
}
// Check which edge has generated the irq
if ((gpio->IDR & pin) == 0) {
@ -99,9 +100,11 @@ static void handle_interrupt_in(uint32_t irq_index, uint32_t max_num_pin_line)
} else {
irq_handler(gpio_channel->channel_ids[gpio_idx], IRQ_RISE);
}
return;
}
}
}
error("Unexpected Spurious interrupt, index %d\r\n", irq_index);
}