mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			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
							parent
							
								
									ade981dc9e
								
							
						
					
					
						commit
						cea91306de
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue