Interrupt Mode HAL Delay
Hello
I am newbie to embedded word. I am trying to learn interrupt for GPIO on NUCLEO-F091RC. I set the User Button as interrupt and LED should toggle as button is pressed. I copied the callback function ( HAL_GPIO_EXTI_Callback) in main.c . Under callback function, I called HAL_GPIO_Toggle . The code is working as expected.
But now I want LED to Blink as interrupt from button is generated. I wrote the below code. But as soon code comes to HAL_Delay function , it hangs. I tried to check in debug mode also. As I come to HAL_Delay function- StepInto , StepOver button fades out and code hangs there.
************************************************
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
while(1)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
HAL_Delay(1000);
}
}
