NVIC抢占优先级总结
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority:
优先级数字越小,优先级越高
实例:
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
// NVIC_PriorityGroup_1 决定了先占优先级 可选0-1 , 从优先级 可选0-7 NVIC_InitStructure.NVIC_IRQChannel=TIM3_IRQn; //定时器3中断
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=0; //先占优先级0,可选0-1
NVIC_InitStructure.NVIC_IRQChannelSubPriority=7; //从优先级7,可选0-7
NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
NVIC_Init(&NVIC_InitStructure);