#define uchar unsigned char
void write_byte24c02(uchar date) //写字节
{
sj=0;
uchar i,temp;
temp=date;
for(i=0;i<8;i++)
{
temp=temp<<1;
scl=0;
delay();
sda=CY;
delay();
scl=1;
delay();
}
scl=0;
delay();
sda=1;
delay();
sj=1;
}
uchar read_byte24c02() //读字节
{
sj=0;
uchar j,l;
scl=0;
delay();
sda=1;
delay();
for(j=0;j<8;j++)
{
scl=1;
delay();
l=(l<<1)|sda;
scl=0;
delay();
}
return l;
sj=1;
}
不知道为什么不能编译
出现如下:
compiling main.c...
MAIN.C(64): error C141: syntax error near 'unsigned'
MAIN.C(64): error C202: 'i': undefined identifier
MAIN.C(65): error C202: 'temp': undefined identifier
MAIN.C(66): error C202: 'i': undefined identifier
MAIN.C(68): error C202: 'temp': undefined identifier
MAIN.C(86): error C141: syntax error near 'unsigned'
MAIN.C(86): error C202: 'j': undefined identifier
MAIN.C(91): error C202: 'j': undefined identifier
MAIN.C(95): error C202: 'l': undefined identifier
MAIN.C(99): error C202: 'l': undefined identifier
Target not created |