title: STM32 HAL GPIO interrupt count too much
body: <p>I've got the following problem:
  I've got 2 inputs on my electronic board:</p>
  
  <pre><code>#define TOR1_IN_uC_Port         GPIOC
  #define TOR1_IN_uC_Pin          GPIO_PIN_5
  #define TOR2_IN_uC_Port         GPIOE
  #define TOR2_IN_uC_Pin          GPIO_PIN_6
  </code></pre>
  
  <p>I've got this initialisation:</p>
  
  <pre><code>GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
  GPIO_InitStruct.Pin = TOR1_IN_uC_Pin;
  HAL_GPIO_Init(TOR1_IN_uC_Port, &amp;GPIO_InitStruct);
  GPIO_InitStruct.Pin = TOR2_IN_uC_Pin;
  HAL_GPIO_Init(TOR2_IN_uC_Port, &amp;GPIO_InitStruct);
  
  HAL_NVIC_SetPriority(EXTI9_5_IRQn, 2, 1);
  HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
  </code></pre>
  
  <p>I've got theses two functions for interruption:</p>
  
  <pre><code>void EXTI9_5_IRQHandler(void)
  {
      if(__HAL_GPIO_EXTI_GET_IT(TOR1_IN_uC_Pin) != RESET)
      {
          HAL_GPIO_EXTI_IRQHandler(TOR1_IN_uC_Pin);
          __HAL_GPIO_EXTI_CLEAR_IT(TOR1_IN_uC_Pin);
      }
      if(__HAL_GPIO_EXTI_GET_IT(TOR2_IN_uC_Pin) != RESET)
      {
          HAL_GPIO_EXTI_IRQHandler(TOR2_IN_uC_Pin);
          __HAL_GPIO_EXTI_CLEAR_IT(TOR2_IN_uC_Pin);
      }
  }
  
  void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
  {
      if (GPIO_Pin == TOR1_IN_uC_Pin)
          Input1.Count++;
      else if (GPIO_Pin == TOR2_IN_uC_Pin)
          Input2.Count++;
  }
  </code></pre>
  
  <p>I've pluged on the inputs a GBF at 10Hz, but the counters counts too much.
  When I print the counters on the serial port, it shows about 5kHz</p>
  
  <p>When I read manually the state of the inputs, I can't verify if the input count too much.</p>