相关代码如下 ,PC5,PB15两个引脚连接同一个脉冲,两个中断都有丢失的情况,如果单独测试,每个脉冲都会产生中断,如果是优先级的问题,应该是中断有先后,但不会丢失啊,大家帮忙分析一下,谢谢
void Exti_int()
{
RCC->APB2ENR|=1<<0; //开启辅助时钟
Ex_NVIC_Config(GPIO_C,9,FTIR); //PC9 IN1/X0
Ex_NVIC_Config(GPIO_B,10,FTIR); //PB10 IN2/X1
Ex_NVIC_Config(GPIO_B,15,FTIR); //PB15 IN7/X6
Ex_NVIC_Config(GPIO_C,5,FTIR); //PC5 IN8/X7
MY_NVIC_Init(2,2,EXTI9_5_IRQChannel,2); //x0,x7
MY_NVIC_Init(1,2,EXTI15_10_IRQChannel,2); //x6,x1
}
void EXTI9_5_IRQHandler(void)
{
if (EXTI->PR & (1<<9))
{
//x0==================================
//======================================
EXTI->PR |= (1<<9);
}
if (EXTI->PR & (1<<5))
{
EXTI->PR |= (1<<5);
//x7=================================
out2++;
clz_cnt++;
clz_flag=1;
//==================================
}
}
void EXTI15_10_IRQHandler(void)
{
if (EXTI->PR & (1<<10))
{
//X1======================================
//=========================================
EXTI->PR |= (1<<10);
}
if (EXTI->PR & (1<<15))
{
EXTI->PR |= (1<<15);
//X6======================================
out1++;
clz_cnt--;
clz_flag=1;
//=========================================
}
} |