cancel
Showing results for 
Search instead for 
Did you mean: 

About how to clear Pending Register

tohru-sagayama
Associate II
Posted on April 08, 2015 at 09:19

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.

Regards
2 REPLIES 2
Amel NASRI
ST Employee
Posted on April 08, 2015 at 18:35

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.

tohru-sagayama
Associate II
Posted on April 09, 2015 at 04:05

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