STM32 F0 Discovery - interrupt question
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-10-03 3:20 PM
Posted on October 04, 2015 at 00:20
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 worksvoid 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!
#interrupt #stm32f0 #discovery-f0
Labels:
- Labels:
-
Interrupt
-
STM32F0 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-10-03 5:11 PM
Posted on October 04, 2015 at 02:11
Doesn't the HAL_Delay rely on the Systick interrupt working? If it's blocking in your interrupt, because of preemption, or M0 things, then it's not going to complete. Consider if a) you need to delay in the IRQ, b) if you can use some other free running timer to mark time.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
