EXTI15_10_IRQnHandler() 中断进不去啊,怎么回事
时间:10-02
整理:3721RD
点击:
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU; //é?à-ê?è?
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource15);//????GPIO1ü??ó?×÷ía2??D?????·
EXTI_InitStructure.EXTI_Line=EXTI_Line15;
EXTI_InitStructure.EXTI_Mode=EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger=EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* éè??NVIC2?êy */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; //′ò?aEXTI2μ?è????D??
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; //?à??ó??è???a0
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2; //?ìó|ó??è???a0
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //ê1?ü
NVIC_Init(&NVIC_InitStructure);
void EXTI15_10_IRQnHandler() //ía2??D??2?D??oˉêy
{
if(EXTI_GetITStatus(EXTI_Line15)==SET)
{
EXTI_ClearITPendingBit(EXTI_Line15);//??3yEXTI???·1ò?e??
delay_ms(50);//????′|àí
if(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_15)==Bit_RESET) //k_left°′?ü°′??
{
delay_ms(50);//????′|àí
LED1_ON;
LED2_ON;
LED3_ON;
LED4_ON;
LED5_ON;
}
while(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_15)==0);
}
}
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource15);//????GPIO1ü??ó?×÷ía2??D?????·
EXTI_InitStructure.EXTI_Line=EXTI_Line15;
EXTI_InitStructure.EXTI_Mode=EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger=EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* éè??NVIC2?êy */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; //′ò?aEXTI2μ?è????D??
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; //?à??ó??è???a0
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2; //?ìó|ó??è???a0
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //ê1?ü
NVIC_Init(&NVIC_InitStructure);
void EXTI15_10_IRQnHandler() //ía2??D??2?D??oˉêy
{
if(EXTI_GetITStatus(EXTI_Line15)==SET)
{
EXTI_ClearITPendingBit(EXTI_Line15);//??3yEXTI???·1ò?e??
delay_ms(50);//????′|àí
if(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_15)==Bit_RESET) //k_left°′?ü°′??
{
delay_ms(50);//????′|àí
LED1_ON;
LED2_ON;
LED3_ON;
LED4_ON;
LED5_ON;
}
while(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_15)==0);
}
}
stm32f103c8t6芯片。。