How to correctly enable innerrupt on Falling edge of built-in button of Nucleo-G474RE ?
Hello, I'm trying to follow the MOOC STM32CubeIDE tutorial on External interrupts with HAL (https://www.youtube.com/watch?v=w_81fHydEoE&list=PLnMKNibPkDnFCosVVv98U5dCulE6T3Iy8&index=6) but on Nucleo-G474RE board with STM32CubeIDE 1.13.1.
My confusion starts after the generation of code and checking the content of `stm32g4xx_hal_gpio.c` file. According to a tutorial, the section related to interrupts on falling edge supposed to look like this:
```
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
{
/* EXTI line interrupt detected */
if (__HAL_GPIO_EXTI_GET_RISING_IT(GPIO_Pin) != 0x00u)
{
__HAL_GPIO_EXTI_CLEAR_RISING_IT(GPIO_Pin);
HAL_GPIO_EXTI_Rising_Callback(GPIO_Pin);
}
if (__HAL_GPIO_EXTI_GET_FALLING_IT(GPIO_Pin) != 0x00u)
{
__HAL_GPIO_EXTI_CLEAR_FALLING_IT(GPIO_Pin);
HAL_GPIO_EXTI_Falling_Callback(GPIO_Pin);
}
}
__weak void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
{
UNUSED(GPIO_Pin);
}
```
Instead, the generated code is:
```
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
{
/* EXTI line interrupt detected */
if (__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != 0x00u)
{
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
HAL_GPIO_EXTI_Callback(GPIO_Pin);
}
}
__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
UNUSED(GPIO_Pin);
}
```
How to make it correct or how to use the resulting callback on falling edge only?