中断的问题

[复制链接]
1842|2
 楼主| a1z26 发表于 2008-12-16 09:54 | 显示全部楼层 |阅读模式
ic, vi, IO, ni, TI
如果只用到一个中断,如EXTI_Line9,那设置中断优先级
分组,指定抢占优先级和相应优先级还有意义吗?程序
如下:

void NVIC_Configuration(void)
{
  NVIC_InitTypeDef NVIC_InitStructure;
  
#ifdef  VECT_TAB_RAM  
  /* Set the Vector Table base location at 0x20000000 */ 
  NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); 
#else  /* VECT_TAB_FLASH  */
  /* Set the Vector Table base location at 0x08000000 */ 
  NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);   
#endif

  /* Configure one bit for preemption priority */
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
  
  /* Enable the EXTI9_5 Interrupt */
  NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&NVIC_InitStructure);
}
香水城 发表于 2008-12-16 10:03 | 显示全部楼层

如果只有一个中断,当然优先级就没有意义了

但为了以后扩展最好设置一下优先级。
 楼主| a1z26 发表于 2008-12-16 10:08 | 显示全部楼层

OK

好的,谢谢指教!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

28

主题

214

帖子

0

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