} void TIM8_UP_IRQHandler(){ TIM_ClearITPendingBit(TIM8, TIM_IT_Update);}
25 void TIM1_UP_IRQHandler(void) 26 { 27 //TIM_TimeBaseStructure.TIM_Period = 100-1;//自动重装值(此时进中断的周期为100ms) 28 if (TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET) 29 { 30 //添加行程开关去抖程序 31 if(XingChengTickNum_QuFantan<1000)// 32 { 33 XingChengTickNum_...
void TIM1_UP_TIM10_IRQHandler(void){ TIM_ClearFlag(TIM1,TIM_FLAG_Update);//进入中断先清除...
25 void TIM1_UP_IRQHandler(void) 26 { 27 //TIM_TimeBaseStructure.TIM_Period = 100-1;//自动重装值(此时进中断的周期为100ms) 28 if (TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET) 29 { 30 //添加行程开关去抖程序 31 if(XingChengTickNum_QuFantan<1000)// 32 { 33 XingChengTickNum_...
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIM向上计数模式 TIM_TimeBaseInit(...
如果是1分频则会是36MHZ输⼊,如果4分频:CKINT=72MHZ/4x2=36MHZ; 8分频:CKINT=72MHZ/8x2=18MHZ;16分频:CKINT=72MHZ/16x2=9MHZ } 1//系统时钟初始化配置 2void RCC_Configuration(void)3 { 4//定义错误状态变量 5 ErrorStatus HSEStartUpStatus;6//将RCC寄存器重新设置为默认值 7 RCC...
(TIM1,TIM_FLAG_Update); 20 TIM_ITConfig(TIM1,TIM_IT_Update,ENABLE); 21 TIM_Cmd(TIM1, ENABLE); 22 } 23 24 25 void TIM1_UP_IRQHandler(void) 26 { 27 //TIM_TimeBaseStructure.TIM_Period = 100-1;//自动重装值(此时进中断的周期为100ms) 28 if (TIM_GetITStatus(TIM1, TIM_IT_...
void RCC_Configuration(void){ //定义错误状态变量 ErrorStatus HSEStartUpStatus;//将RCC寄存器重新设置为默认值 RCC_DeInit();//打开外部⾼速时钟晶振 RCC_HSEConfig(RCC_HSE_ON);//等待外部⾼速时钟晶振⼯作 HSEStartUpStatus = RCC_WaitForHSEStartUp();if(HSEStartUpStatus == SUCCESS){ //设置AHB...
//时钟分频116TIM_TimeBaseStructure.TIM_RepetitionCounter =0;17TIM_TimeBaseInit(TIM1,&TIM_TimeBaseStructure);1819TIM_ClearFlag(TIM1,TIM_FLAG_Update);20TIM_ITConfig(TIM1,TIM_IT_Update,ENABLE);21TIM_Cmd(TIM1, ENABLE);22}232425voidTIM1_UP_IRQHandler(void)26{27//TIM_TimeBaseStructure.TIM_...
=TIM_CounterMode_Up;1213TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);1415TIM_ClearFlag(TIM2, TIM_FLAG_Update);16TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE);1718TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE);1920TIM_Cmd(TIM2, ENABLE);21}22voidTIM2_IRQHandler(void)23{2425if(TIM_GetIT...