2015-04-08 12:19 AM
Hello.
I'm struggling with clearing pending register. I'm trying to clear the register in EXTI0 handler, but it looks like my program doesn't work. I'm using HAL driver, HAL_GPIO_EXTI_CLEAR_FLAG like below coding; HAL_GPIO_EXTI_CLEAR_FLAG(GPIO_PIN_0); Is above usage correct ? According to the description in stm32f4xx_hal_gpio.h, __EXTI__LINE__ in the macro, HAL_GPIO_EXTI_CLEAR_FLAG means GPIO pin number like GPIO_PIN_0. Regards2015-04-08 09:35 AM
Yes this usage is correct.
Are you facing any issue with EXTI flag clearing?-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-04-08 07:05 PM
Hello, Mayla
Thank you for your comment. Yes, I'm facing issue so that I can't clear pending bit regardless of correct usage. And I'm afraid the macro is wrong to clear pending bit as far as I walk through stm32f4xx_hal_gpio.h because the macro just assigns GPIO_PIN_x to EXTI.PR. So I gave up the idea of using the macro, and I wrote the description that clears pending bit directly like following statement; EXTI_TypeDef Exti_reg; Exti_reg.PR &= 0xfffe; Could you please check if the statement of the macro is correct if you don't mind ? Regards