/* Set Threshold register. 
set the threshold register in the NVIC.  */
void drv_nvic_set_threshold(uint32_t VectThreshold, uint32_t PrioThreshold)
/* Set Threshold register. 
set the threshold register in the NVIC.  */
void drv_nvic_set_threshold(uint32_t VectThreshold, uint32_t PrioThreshold)
{
    NVIC->IPTR = 0x80000000 | (((VectThreshold + 32) & 0xFF) << 8) | ((PrioThreshold & 0x3) << 6);
}