void PB4_ExintEnable(u8 en)
{
GPIO_InitTypeDef GPIO_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
if(en)
{
GPIO_EXTLineConfig(GPIO PortSourceGPIOA, GPIO_PinSource0);
EXTI_InitStructure.EXTI_Line = EXTI_Line;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; //ϽµÑØÖжÏ
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
}
else
{
EXTI_InitStructure.EXTI_LineCmd = DISABLE;
}
EXTI_Init(&EXTI_InitStructure);
}
这样写,不知道行不行。 |