/******************************************************************************* * Function Name : TIM2_IRQHandler TIM2中断 * Description : This function handles TIM2 global interrupt request. * Input : None * Output : None * Return : None *******************************************************************************/ extern u32 count=0; extern u8 flag=0; void TIM2_IRQHandler(void) { if (TIM_GetITStatus(TIM2, TIM_IT_CC1) != RESET) { //必须清空标志位/ / TIM_ClearITPendingBit(TIM2, TIM_IT_CC1); //点亮LED5// LED5_ON; //LED1直接操作寄存器方式的闪烁 GPIOA->ODR^=GPIO_Pin_8; } else if (TIM_GetITStatus(TIM2, TIM_IT_CC2) != RESET) { TIM_ClearITPendingBit(TIM2, TIM_IT_CC2); //点亮LED6// LED6_ON; } else if (TIM_GetITStatus(TIM2, TIM_IT_CC3) != RESET) { TIM_ClearITPendingBit(TIM2, TIM_IT_CC3); // 点亮LED7// LED7_ON; } else if (TIM_GetITStatus(TIM2, TIM_IT_CC4) != RESET) { TIM_ClearITPendingBit(TIM2, TIM_IT_CC4); //点亮LED8// LED8_ON; } else if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET) { TIM_ClearITPendingBit(TIM2, TIM_IT_Update); //熄灭所有LED// count++; flag=1; if(count>=99999999) count=0; LED5_OFF; LED6_OFF; LED7_OFF; LED8_OFF; } } /******************************************************************************* * Function Name : TIM3_IRQHandler * Description : This function handles TIM3 global interrupt request. * Input : None * Output : None * Return : None *******************************************************************************/ void TIM3_IRQHandler(void) { } |