2017-09-27 07:33 PM
I noticed there are already several questions about reading both edges in an EXTI callback, but my problem seems different as it involves waking up from sleep. Anyway, do point me to the right place if this has already been answered.
Basically I am trying to determine whether a rising or falling edge triggered an EXTI on a GPIO pin.
1) I configure the interrupt for both rising + falling edges
2) in the interrupt callback i call HAL_GPIO_ReadPin() to determine whether the pin is HIGH or LOW
The read value is correct under normal conditions (microcontroller is awake). But the value I get is incorrect following a wakeup, such as in the following steps.
1) Same configuration as before(configure the interrupt for both rising + falling edges)
2) Wait for interrupt using HAL_PWR_EnterSTOPMode( PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI );
3) in the interrupt callback i call
HAL_GPIO_ReadPin() to determine whether the pin is HIGH or LOW
4) The read value is always LOW even when it should be HIGH
Am I missing some step here? Do I have to enable something first that refreshed the GPIO read register?
Thanks in advance.
2018-05-24 12:47 PM
Hi Julian,
Were you able to fix this issue? Can you let us know how you were able to overcome the problem.
Thanks,
Harsha