我在keil软件里编了一个程序,通过此软件编译连接是好的,无错误,无警告。但当我把它放到仿真器软件里时编译的时候就有错误了,这是怎么一回事?应该如何解决它。以下是那个软件以及仿真软件提示的错误,请大家给我指点一下了,谢谢!
//===================================================
#include
#include
#include
//***************************************************
//========================================================
void main(void)
{
init_mcu();
while(1)
{
display();
Delay(200);
check_key();
chuli();
do_deed();
Delay(200);
}
}
//****************************************************
//=====================================================
void int_0(void) interrupt 0 using 1
{
flag++;
switch(flag%5)
{
case 2: ind0 = P1_0; ind1 = P1_1; ind2 = P1_2; ind3 = P1_3; break;
case 3: ind4 = P1_0; ind5 = P1_1; ind6 = P1_2; ind7 = P1_3; break;
case 4: ind8 = P1_0; ind9 = P1_1; ind10= P1_2; ind11= P1_3; break;
case 0: ind12= P1_0; ind13= P1_1; ind14= P1_2; ind15= P1_3; break;
default: ;
}
if(flag==5) flag=0;
}
//****************************************************
//====================================================
void init_mcu(void)
{
P1 = 0xff;
P3 = 0xff;
EA = 1;
EX0 = 1;
PX0 = 1;
IE0 = 1;
}
//********************************************************
//===================================================
unsigned char check_key(void)
{
if((P3_0==0)||(P3_1==0)) keys=3;
else
{
if(P3_1==0) keys=2;
if(P3_0==0) keys=1;
}
return keys;
}
//****************************************************
//====================================================
void display(void)
{
END = 0;
Delay(200);
IICSendhead();
IICSendByte(instr1);
IICSendByte(instr2);
Delay(200);
END = 1;
}
//****************************************************
//====================================================
void displaytt(unsigned char c)
{
unsigned char t1,t2;
t1=c;
t2=c<<4;
ind1=t1+t2;
ind2=t1+t2;
END = 0;
Delay(200);
IICSendhead();
IICSendByte(ind1);
IICSendByte(ind2);
Delay(200);
END = 1;
}
//****************************************************
//====================================================
void chuli(void)
{
switch(keys)
{
case 3: displaytt(3); break;
case 2: displaytt(2); break;
case 1: displaytt(1); break;
default: ; break;
}
}
//****************************************************
//====================================================
void do_deed(void)
{
switch(keys)
{
case 3: P3_7=1; P3_5=1; break;
case 2: P3_7=1; P3_5=0; break;
case 1: P3_7=0; P3_5=1; break;
default: P3_7=0; P3_5=0; break;
}
}
//****************************************************
//========向MC14499写小数点位=========================
void IICSendhead(void)
{
unsigned char i;
for(i=0;i<4;i++)
{
SCL=0;
SCL=0;
SDA=1;
SCL=1;
SCL=1;
}
}
//****************************************************
//========向IIC总线写数据=============================
void IICSendByte(unsigned char sendbyte)
{
unsigned char data j=8;
for(;j>0;j--)
{
SCL=0;
sendbyte<<=1;
SDA=CY;
SCL=1;
}
SCL=0;
}
//****************************************************
//======一个简单延时程序==============================
void Delay(unsigned char DelayCount)
{
while(DelayCount--);
}
提示的错误如下:
can't open file "AT892051.H"
CS.C(29): error C202: 'P1_0': undefined identifier
CS.C(29): error C202: 'P1_1': undefined identifier
CS.C(29): error C202: 'P1_2': undefined identifier
CS.C(29): error C202: 'P1_3': undefined identifier
CS.C(30): error C202: 'P1_0': undefined identifier
CS.C(30): error C202: 'P1_1': undefined identifier
CS.C(30): error C202: 'P1_2': undefined identifier
CS.C(30): error C202: 'P1_3': undefined identifier
CS.C(42): error C202: 'P1': undefined identifier
CS.C(43): error C202: 'P3': undefined identifier
CS.C(44): error C202: 'EA': undefined identifier
CS.C(45): error C202: 'EX0': undefined identifier
CS.C(46): error C202: 'PX0': undefined identifier
CS.C(47): error C202: 'IE0': undefined identifier
CS.C(31): error C202: 'P1_0': undefined identifier
CS.C(31): error C202: 'P1_1': undefined identifier
CS.C(31): error C202: 'P1_2': undefined identifier
CS.C(31): error C202: 'P1_3': undefined identifier
CS.C(32): error C202: 'P1_0': undefined identifier
CS.C(32): error C202: 'P1_1': undefined identifier
CS.C(32): error C202: 'P1_2': undefined identifier
CS.C(32): error C202: 'P1_3': undefined identifier
CS.C(42): error C202: 'P1': undefined identifier
CS.C(43): error C202: 'P3': undefined identifier
CS.C(54): error C202: 'P3_0': undefined identifier
CS.C(57): error C202: 'P3_1': undefined identifier
CS.C(58): error C202: 'P3_0': undefined identifier
CS.C(113): error C202: 'P3_7': undefined identifier
CS.C(113): error C202: 'P3_5': undefined identifier
CS.C(114): error C202: 'P3_7': undefined identifier
CS.C(114): error C202: 'P3_5': undefined identifier
CS.C(115): error C202: 'P3_7': undefined identifier
CS.C(115): error C202: 'P3_5': undefined identifier
CS.C(116): error C202: 'P3_7': undefined identifier
CS.C(116): error C202: 'P3_5': undefined identifier
CS.C(142): error C202: 'CY': undefined identifier