为什么把keil的程序导入isis时会出现一直转圈运行不出来的问题
如下为keil程序:
#include
#define uchar unsigned char
#define uint unsigned int
sbit speak=P2^0;
sbit host=P2^2;
uchar GroupNo,t,flag;
uchar code Seg7code[9]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f};//0到8的代码
void delay1ms(void)//延迟1毫秒
{uchar i;
for(i=250;i>0;i--);
}
void ShowG(uchar no)//显示出第几组
{P1=Seg7code[no];}
uchar KeySweep(void)//键盘扫描,获取组数
{uchar temp,no=0;
if(P3!=0xff)
{delay1ms();
if(P3!=0xff)
temp=~P3;
}
while(temp!=0)
{temp=temp>>1;
no++;
}
return no;
}
void timer0(void) interrupt 1
{ TH0=(65536-500)/256;
TL0=(65536-500)%256;
speak=~speak;
}
void InitTime0(void)//定时器0初始化
{TMOD=0x01;
TH0=(65536-500)/256;
TL0=(65536-500)%256;
ET0=1;
EA=1;
}
void main()
{InitTime0();
while(1)
{P3=0xff;
ShowG(0);
while(host==1);
delay1ms();
while(host==1);
while(P3==0xff);
GroupNo=KeySweep();
ShowG(GroupNo);
TR0=1;
while(host==1);
delay1ms();
while(host==1);
TR0=0;
}
}