#include"2272remote.h"
void RemoteConfig(void)
{
CLK_PeripheralClockConfig(CLK_PERIPHERAL_TIMER1,ENABLE);
GPIO_Init(GPIOC,GPIO_PIN_6, GPIO_MODE_IN_PU_NO_IT );
TIM1_TimeBaseInit(15,TIM1_COUNTERMODE_UP,20000,0);
TIM1_ICInit(TIM1_CHANNEL_1, TIM1_ICPOLARITY_RISING, TIM1_ICSELECTION_DIRECTTI, TIM1_ICPSC_DIV1,3);
ITC_SetSoftwarePriority(ITC_IRQ_TIM1_OVF,ITC_PRIORITYLEVEL_2);
ITC_SetSoftwarePriority(ITC_IRQ_TIM1_CAPCOM,ITC_PRIORITYLEVEL_1);
TIM1_ITConfig(TIM1_IT_CC1,ENABLE);
TIM1_ITConfig(TIM1_IT_UPDATE,ENABLE);
TIM1_Cmd(ENABLE);
}
为啥捕获中断都进不去配置哪里出错了
定时器进去了时间也对
|