下面是IAR的例子中的程序,我在看这个,总觉的搞错了,
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);
在程序中NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);是设置优先级分组,选的是组1先占优先级1位,从优先级3位。那NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2;是什么意思?我认为NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority只能为0或1,怎么能为2呢? |