AnsweredAssumed Answered

STM32 F0 Discovery - interrupt question

Question asked by eng.new on Oct 4, 2015
Latest reply on Oct 4, 2015 by Clive One
I am CubeFX and Keil. Hardware is Discovery board with STM32F051R8T6. Created an interrupt for PA0 (user button) and toggle an led (PC9 green LED).

This works
void EXTI0_1_IRQHandler(void)
{
    
    if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0))
    {
        HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_9);
    }
  
  HAL_NVIC_ClearPendingIRQ(EXTI0_1_IRQn);
  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);
}

This does not work (only difference is the HAL_Delay(100) )
void EXTI0_1_IRQHandler(void)
{
    
    if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0))
    {
        HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_9);
        HAL_Delay(100);
    }
  
  HAL_NVIC_ClearPendingIRQ(EXTI0_1_IRQn);
  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);
}
 
What I am doing wrong here? new to the ARM world.
Thanks You!

Outcomes