以下代码,当IRQn等于SysTick_IRQn=-1时,((uint32_t)(IRQn) & 0xF)-4=-3, SCB->SHP[-3],c语言还可以这样访问吗? 还是我理解错了,请帮忙看下呢~~
[C] 纯文本查看 复制代码static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
if(IRQn < 0) {
SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M3 System Interrupts */
else {
NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
} |