change led to timer int
This commit is contained in:
@@ -107,6 +107,8 @@ void EXTI4_15_IRQHandler(void){
|
||||
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
/**
|
||||
* @brief This function handles TIMER2 interrupt request.
|
||||
* @param None
|
||||
@@ -114,9 +116,15 @@ void EXTI4_15_IRQHandler(void){
|
||||
*/
|
||||
void TIMER2_IRQHandler(void)
|
||||
{
|
||||
|
||||
if (SET == timer_interrupt_flag_get(TIMER2, TIMER_INT_FLAG_CH0))
|
||||
{
|
||||
chbsp_led_toggle(0);
|
||||
i++;
|
||||
timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_CH0);
|
||||
if (i == 10)
|
||||
{
|
||||
chbsp_led_toggle(0);
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user