Did anyone have idea on how to write a code to blink LED using timer delay and Timer interrupt in STM32 controller. Timer interrupt is for during delay if any other input comes the system shouldn't get hanged.
that one i have already doneFirst step is to write code to blink an LED using software delay.
Good.that one i have already done
volatile bool LEDOn = false;
// Called when the timer expires
InterruptHandler()
{
// Toggle the LED flag
LEDOn = !LEDOn;
}
Init()
{
// Create a timer that calls InterruptHandler() every 2 seconds
CreateTimer(2_seconds, &InterruptHandler);
}
main_loop()
{
while(1)
{
if(LEDon)
SetLEDPin(high);
else
SetLEDPin(low);
// Do other stuff here, nothing is hung....
}
}
main()
{
Init();
main_loop();
}
I have done blinking LED using Timer delay & Software delay interrupt part i am confused how to give. i have setted the priority as 1Good.
Next step is to implement the delay by polling a flag in the timer module.
I have done blinking LED using Timer delay & Software delay interrupt part i am confused how to give. i have setted the priority as 1Good.
Next step is to implement the delay by polling a flag in the timer module.
by Duane Benson
by Jake Hertz
by Jerry Twomey
by Jake Hertz