if (TIM_GetITStatus(TIM4, TIM_IT_CC1) != RESET)
{
if(TIM4CH1_CAPTURE_STA&0X40)
{
TIM4CH1_CAPTURE_STA|=0X80;
TIM4CH1_CAPTURE_VAL=TIM_GetCapture1(TIM4);
TIM_OC1PolarityConfig(TIM4,TIM_ICPolarity_Rising);
}else
{
TIM4CH1_CAPTURE_STA=0;
TIM4CH1_CAPTURE_VAL=0;
TIM_SetCounter(TIM4,0);
TIM4CH1_CAPTURE_STA|=0X40;
TIM_OC1PolarityConfig(TIM4,TIM_ICPolarity_Falling);
}
}
}
TIM_ClearITPendingBit(TIM4, TIM_IT_CC1|TIM_IT_Update);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>