STM32 3.0库中断优先级

[复制链接]
2121|1
 楼主| anvy178 发表于 2012-3-19 15:57 | 显示全部楼层 |阅读模式
在CM3_CORE.H 这个文件中有一个设置中断优先级的函数
static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, int32_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      */
}

NVIC->IP 里设置的中断优先级高  还是SCB->SHP里设置的中断优先级高啊
 楼主| anvy178 发表于 2012-3-19 16:05 | 显示全部楼层
Note: The priority cannot be set for every core interrupt.   这句话确切意思是什么 这句话是相对于上面那个函数的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

75

主题

801

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部