|
一个是外部中断,一个是时钟中断。
设置如下,
//PC7
nvic_init.NVIC_IRQChannel = EXTI9_5_IRQChannel;
nvic_init.NVIC_IRQChannelPreemptionPriority = 0;
nvic_init.NVIC_IRQChannelSubPriority = 0;
nvic_init.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_init);
//timer3
nvic_init.NVIC_IRQChannel = TIM3_IRQChannel;
nvic_init.NVIC_IRQChannelPreemptionPriority = 0;
nvic_init.NVIC_IRQChannelSubPriority = 0;
nvic_init.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&nvic_init);
这2个中断优先级一样吗?
外部中断会在TIM3中断中,在某种条件下关闭中断模式,
EXTI->IMR 相应位置设0。
现在出现一个现象,在外界干扰下,会进入外部中断并且此时外部中断已经被时钟中断关闭(debug可以发现相应位 EXTI->IMR 是0)
}
|
|