1.NVIC初始化流程
<1>配置中断优先级分组
void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
<2>建立NVIC初始化结构体
NVIC_InitTypeDef NVIC_InitStructure;
<3>配置NVIC结构体并初始化
NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
|