image.png
    image.png

    附:NVIC初始化参数配置:

    1. NVIC_InitTypeDef NVIC_InitStructure; //定义结构体
    2. NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
    3. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3 ; //抢占优先级
    4. NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //响应优先级
    5. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能NVIC分组