#include "sr_bsp_com.h"

void HAL_NvicConfig(IRQn_Type IRQn, uint8_t PreemptPriority, uint8_t SubPriority)
{
    NVIC_InitType NVIC_InitStructure;

    /* Configure the NVIC Preemption Priority Bits（在start_up.c里中配置） */
    
    /* Enable the USARTy Interrupt */
    NVIC_InitStructure.NVIC_IRQChannel = IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PreemptPriority;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = SubPriority;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    NVIC_Init(&NVIC_InitStructure);
}

void HAL_NvicDisable(IRQn_Type IRQn)
{
    NVIC_InitType NVIC_InitStructure;

    /* Disable the USARTy Interrupt */
    NVIC_InitStructure.NVIC_IRQChannel = IRQn;
    NVIC_InitStructure.NVIC_IRQChannelCmd = DISABLE;
    NVIC_Init(&NVIC_InitStructure);
}



