change led to timer int

This commit is contained in:
wanghao
2024-08-14 17:02:31 +08:00
parent 27a1f5624e
commit fedc3042be
2 changed files with 10 additions and 2 deletions

View File

@@ -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;
}
}
}