打印

STR710 中断时灵时不灵问题

[复制链接]
1737|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
blueseed|  楼主 | 2009-12-21 09:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在中断中设置了中断优先级如下,外部中断优先级最高,但是只要我进入过外部中断后,其它中断就进不去了
void EIC_IRQ_Init(void)
{
EIC_IRQChannelPriorityConfig(UART2_IRQChannel, 5);
EIC_IRQChannelConfig(UART2_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(UART1_IRQChannel, 4);
EIC_IRQChannelConfig(UART1_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(T1TIMI_IRQChannel, 3);
EIC_IRQChannelConfig(T1TIMI_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(T3TIMI_IRQChannel, 2);
EIC_IRQChannelConfig(T3TIMI_IRQChannel, ENABLE);

  EIC_IRQChannelPriorityConfig ( XTI_IRQChannel , 1 );
  EIC_IRQChannelConfig ( XTI_IRQChannel , ENABLE );   
EIC_IRQConfig(ENABLE); //使能IRQ中断
}
但是如果我把所有的中断优先级别设置成一样,中断就能顺利进行,何解??
void EIC_IRQ_Init(void)
{
EIC_IRQChannelPriorityConfig(UART2_IRQChannel, 1);
EIC_IRQChannelConfig(UART2_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(UART1_IRQChannel, 1);
EIC_IRQChannelConfig(UART1_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(T1TIMI_IRQChannel, 1);
EIC_IRQChannelConfig(T1TIMI_IRQChannel, ENABLE);
EIC_IRQChannelPriorityConfig(T3TIMI_IRQChannel, 1);
EIC_IRQChannelConfig(T3TIMI_IRQChannel, ENABLE);
  EIC_IRQChannelPriorityConfig ( XTI_IRQChannel , 1 );
  EIC_IRQChannelConfig ( XTI_IRQChannel , ENABLE );   
EIC_IRQConfig(ENABLE); //使能IRQ中断
}
沙发
blueseed|  楼主 | 2009-12-21 16:47 | 只看该作者
我错了,是硬件出问题了
结案,嘿嘿

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

20

帖子

1

粉丝