2017-11-27 01:40 AM
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 */
}#cubemx-4.18 #interrput #rising-edgeSolved! Go to Solution.
2017-11-27 03:01 AM
I use
CLEAR_BIT(EXTI->RTSR,EXTI_RTSR_TR3);
SET_BIT(EXTI->FTSR,EXTI_FTSR_TR3);istead of :
CLEAR_BIT(EXTI->RTSR,0X03);
SET_BIT(EXTI->FTSR,0X03);then, my problem is solved
2017-11-27 03:01 AM
I use
CLEAR_BIT(EXTI->RTSR,EXTI_RTSR_TR3);
SET_BIT(EXTI->FTSR,EXTI_FTSR_TR3);istead of :
CLEAR_BIT(EXTI->RTSR,0X03);
SET_BIT(EXTI->FTSR,0X03);then, my problem is solved