void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct)
{
u32 tmppriority = 0x00, tmpreg = 0x00, tmpmask = 0x00;
u32 tmppre = 0, tmpsub = 0x0F;
/* Check the parameters */
assert(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd));
assert(IS_NVIC_IRQ_CHANNEL(NVIC_InitStruct->NVIC_IRQChannel));
assert(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority));
assert(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority));
if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE)
{
/* Compute the Corresponding IRQ Priority --------------------------------*/
tmppriority = (0x700 - (SCB->AIRC & (u32)0x700))>> 0x08;//算出来得到的就是占先优先级的位数占四位中的几位
tmppre = (0x4 - tmppriority);
//算出来得到的就是响应优先级的位数占四位中的几位
tmpsub = tmpsub >> tmppriority;
//然后将四位掩码通过抢占优先级位数得到响应优先级的掩码
tmppre = (0x4 - tmppriority);
//算出来得到的就是响应优先级的位数占四位中的几位
这句代码是什么意思啊,不会产生益出吗 ?
哪位大虾帮忙解释下 |