AnsweredAssumed Answered

how to change an external interrupt level on its interrupt

Question asked by Hossein Golshik on Nov 27, 2017
Latest reply on Nov 27, 2017 by Hossein Golshik

hi,

I set external interrupt 3 on cubemx to Rising edge and need to change of trigger level that on its routine.

I write this code on interrupt 3 routine, but it always trigger by rising edge (down't execute falling edge) (PLEASE: see attach image)

 

how can I fix this problem with HAL driver command?

void EXTI3_IRQHandler(void)
{
  /* USER CODE BEGIN EXTI3_IRQn 0 */
switch(valuee){
    case 10:
    HAL_GPIO_WritePin(RLED_GPIO_Port,RLED_Pin, GPIO_PIN_SET);
    CLEAR_BIT(EXTI->RTSR,0X03);
    SET_BIT(EXTI->FTSR,0X03);
    valuee=15;
    break;
    
    case 15:
    HAL_GPIO_WritePin(RLED_GPIO_Port,RLED_Pin, GPIO_PIN_RESET);
    CLEAR_BIT(EXTI->FTSR,0X03);
    SET_BIT(EXTI->RTSR,0X03);
    valuee=10;

 

    break;
}
  /* USER CODE END EXTI3_IRQn 0 */
  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);
  /* USER CODE BEGIN EXTI3_IRQn 1 */

 

  /* USER CODE END EXTI3_IRQn 1 */
}

 

 

Attachments

Outcomes