|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2013-3-29 17:54:52
|
显示全部楼层
贝贝M 发表于 2013-3-29 15:13 ![](static/image/common/back.gif)
怀疑是你的中断函数有问题
void wbzdf() interrupt 0 //外部中断函数
{
uchar count,m,n;
EX0=0;
IE0=0;
while(!hwir); //9秒的低位引导码
while(hwir); //4.5秒的高位引导码
for(m=0;m<4;m++)
{
for(n=0;n<8;n++)
{
while(!hwir); //等低电平结束
while(hwir) //计算高电平时间
{
delay(1);
count++;
}
ir[m]=ir[m]>>1;
if(count>5) //若超过1.12ms,赋1
{
ir[m]=ir[m]|0x80;
}
count=0;
}
}
ir[4]=ir[2]&0x0f; //为ir[4]和ir[5]赋值
ir[5]=ir[2]>>4; //9秒的低位引导码
display(0x01,0x04);
// P1=ir[4];
delay(2000L);
P1=~P1;
EX0=1;
}
本来的中断函数经过调试以后被我改成这样了,就是想知道程序执行的过程。原来的程序和这个的结果是一样的,都是返回不了主函数。求教。 |
|