博士
最后登录1970-1-1
在线时间 小时
注册时间2014-10-24
|
#define LD3320IRQ_GPIO_CLK RCC_APB2Periph_GPIOB
#define LD3320IRQ_PIN GPIO_Pin_12
#define LD3320IRQ_GPIO_PORT GPIOB
#define LD3320IRQEXIT_PORTSOURCE GPIO_PortSourceGPIOB
#define LD3320IRQPINSOURCE GPIO_PinSource12
#define LD3320IRQEXITLINE EXTI_Line12
#define LD3320IRQN EXTI15_10_IRQn
static void LD3320_EXTI_Cfg(void)
{
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
RCC_APB2PeriphClockCmd(LD3320IRQ_GPIO_CLK, ENABLE); //GPIOB ê1Äü
GPIO_InitStructure.GPIO_Pin =LD3320IRQ_PIN; //GPIOB 12½ÅÎaÖD¶Ï½Å
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(LD3320IRQ_GPIO_PORT, &GPIO_InitStructure);
//ía2¿ÖD¶ÏÏßÅäÖÃ
GPIO_EXTILineConfig(LD3320IRQEXIT_PORTSOURCE, LD3320IRQPINSOURCE);
EXTI_InitStructure.EXTI_Line = LD3320IRQEXITLINE;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger =EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
//ÖD¶ÏǶì×ÅäÖÃ
NVIC_InitStructure.NVIC_IRQChannel = LD3320IRQN;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
void EXTI15_10_IRQHandler(void)
{}
上面这段中断代码老是不行!把管脚改为12就行!什么情况啊?改成其它管脚也不行!
|
|