stm32中NVIC如何配置?
1、NVIC优先级分组
2、初始化NVIC
// NVIC优先级分组
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
// NVIC初始化
NVIC_InitTypeDef NVIC_InitStructrue;
NVIC_InitStructrue.NVIC_IRQChannel=TIM2_IRQn;
NVIC_InitStructrue.NVIC_IRQChannelCmd=ENABLE;
NVIC_InitStructrue.NVIC_IRQChannelPreemptionPriority=2; // 抢断优先级
NVIC_InitStructrue.NVIC_IRQChannelSubPriority=1; //响应优先级
NVIC_Init(&NVIC_InitStructrue);