首先,谢谢你花时间看我的问题。
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;
} |