#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit s1=P2^4;
sbit s6=P2^3;
sbit s2=P2^2;
sbit s3=P2^1;
sbit s4=P2^0;
sbit s5=P0^4;
sbit key0=P0^0;
sbit key1=P0^1;
sbit key2=P0^2;
sbit key3=P0^3;
void KEY_Init(void);
delay1s(uint x)
{uchar n;
while(x--)
{for(n=0;n<125;n++);}
}
main()
{
if(key3==1)
if(s1==0)
if(key0==0){goto loop1;}
else
;
else
if(extern key0 SwitchFlagshort==0){goto loop2;}
else
;
if(extern key0 SwitchFlaglong==0){goto loop3;}
else
;
loop:s1=1;
s3=1;
delay1s();
P2=0xff;
loop2:s1=1;
s3=1;
delay1s();
P2=0xff;
loop3:s1=0;
else
if(s1==0)
if(extern key0 SwitchFlagshort==0){goto loop4;}
else
;
if(extern key0 SwitchFlaglong==0){goto loop5;}
else
;
else
if(extern key0 SwitchFlagshort==0){goto loop6;}
else
;
if(extern key0 SwitchFlaglong==0){goto loop7;}
else
;
loop4:s1=1;
loop5:s3=1;
delay4s();
P2=0xff;
loop6: ;
loop7:s1=1;
delay3s();
P2=oxff;
s3=1;
delay4s();
P2=0xff;
if(key3==0||s1==1){s4=1;}
else
s4=0;
if(s1==0&extern key2 Reset1Flagshort==0)
s1=0;
delay1s();
s1=1;
else
;
if(s1==0&&extern key2 Reset1Flaglong==0)
s6=1;
delay3s();
P2=0xff;
else
;
if(key3==0&key1==0)
{
s2=1;
delay1s();
P2=0xff;
}
else
{
;
}
}
compiling 456.c...
456.C(28): error C141: syntax error near 'extern'
456.C(31): error C141: syntax error near 'extern'
456.c - 2 Error(s), 0 Warning(s).
这个错误如何修改啊