打印

这个程序到底哪有问题啊

[复制链接]
946|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
想学ARM|  楼主 | 2009-8-19 18:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
首先,谢谢你花时间看我的问题。
s3c44b0外部中断的一个程序,输入5的话,which_int应该被赋值为10了,那么就可以进入下一个switch()语句。但是,实际调试中,就是进不去下一个switch()语句。我在 while(!which_int);后加了一个显示语句,发现也不显示。为什么跳不出while循环呢?

switch(Uart_Getch())
    {
case '1':
     rEXTINT=0x22222222; //Falling edge mode
     break;
case '2':
     rEXTINT=0x44444444; //Rising edge mode
     break;
case '3':
     rEXTINT=0x77777777; //Both edge mode
     break;
case '4':
     rEXTINT=0x0; //"0" level mode
     break;
case '5':
     Uart_Printf("In this board EINT2 and EINT5 are pulled
up\n");//rEXTINT=0x11111111; //"1" level mode
     which_int=10;
     break;
default:
     rPCONG=save_G;
     rPUPG=save_PG;
     return;
    }
Uart_Printf("Press the EINT buttons!!!\n");
    rINTMSK=~(BIT_GLOBAL|BIT_EINT2|BIT_EINT4567);  
while(!which_int);
switch(which_int)
    {
case 1:
     Uart_Printf("EINT4 had been occured...\n");
     break;
case 2:
     Uart_Printf("EINT5 had been occured...\n");
     break;
case 4:
     Uart_Printf("EINT6 had been occured...\n");
     break;
case 8:
     Uart_Printf("EINT7 had been occured...\n");
     break;
case 9:
     Uart_Printf("EINT2 had been occured...\n");
     break;
default :
  Uart_Printf("wrong");
     break;
    }
    rINTMSK=BIT_GLOBAL;
    rPCONG=save_G;
    rPUPG=save_PG;
    which_int=0;
    rINTCON=0x5;
}

相关帖子

沙发
my8804| | 2009-8-19 22:34 | 只看该作者
你确信输入了的是5么??
有仿真器的话,单步,断点调试下来,很容易发现问题的所在的。

使用特权

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

本版积分规则

5

主题

15

帖子

0

粉丝