我做了一个STMF407的中断嵌套,代码如下:
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_3);
NVIC_InitStructure.NVIC_IRQChannel = EX
ti15_10_IRQn;
NVIC_InitStructure.NVI_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
但运行下来,串口中断和外部中断都可以运行,但外部中断打断不了串口中断,没有实现中断嵌套。
请高手看看怎么回事。多谢了。
把中断的源码也放上来,看看是不是逻辑问题。
一周热门 更多>