#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar temp, t0;
void init();
void main()
{
uint();
while(1)
{
}
}
void uint()
{
temp=0xfe;
P1=temp;
TMOD=0x11; //定时器 0,1
TH0=(65536-50000)/256; //装初值
TL0=(65536-50000)%256;
TH1=(65536-50000)/256; //装初值
TL1=(65536-50000)%256;
EA=1; // 开总中断
ET0=1;
ET1=1;
TR1=1; // 开定时器中断
TR0=1; //启动定时器
}
void time0() interrupt 1 //中断服务程序 1为定时器0函数序号
{
TH0=(65536-50000)/256; //设初值 从新开始计数
TL0=(65536-50000)%256;
t0++;
if(t0=10)
{
t0=0;
temp=_crol_(temp,1);
P1=temp;
}
}
compiling timezhongduan.c...
TIMEZHONGDUAN.C(9): error C141: syntax error near ')'
TIMEZHONGDUAN.C(17): error C141: syntax error near 'unsigned'
TIMEZHONGDUAN.C(17): error C141: syntax error near ')'
TIMEZHONGDUAN.C(19): error C231: 'temp': redefinition
TIMEZHONGDUAN.C(20): error C231: 'P1': redefinition
TIMEZHONGDUAN.C(20): error C247: non-address/-constant initializer
TIMEZHONGDUAN.C(20): error C231: 'P1': redefinition
TIMEZHONGDUAN.C(21): error C231: 'TMOD': redefinition
TIMEZHONGDUAN.C(21): error C231: 'TMOD': redefinition
TIMEZHONGDUAN.C(22): error C231: 'TH0': redefinition
TIMEZHONGDUAN.C(22): error C231: 'TH0': redefinition
TIMEZHONGDUAN.C(23): error C231: 'TL0': redefinition
TIMEZHONGDUAN.C(23): error C231: 'TL0': redefinition
TIMEZHONGDUAN.C(24): error C231: 'TH1': redefinition
TIMEZHONGDUAN.C(24): error C231: 'TH1': redefinition
TIMEZHONGDUAN.C(25): error C231: 'TL1': redefinition
TIMEZHONGDUAN.C(25): error C231: 'TL1': redefinition
TIMEZHONGDUAN.C(26): error C231: 'EA': redefinition
TIMEZHONGDUAN.C(26): error C231: 'EA': redefinition
TIMEZHONGDUAN.C(27): error C231: 'ET0': redefinition
TIMEZHONGDUAN.C(27): error C231: 'ET0': redefinition
TIMEZHONGDUAN.C(28): error C231: 'ET1': redefinition
TIMEZHONGDUAN.C(28): error C231: 'ET1': redefinition
TIMEZHONGDUAN.C(29): error C231: 'TR1': redefinition
TIMEZHONGDUAN.C(29): error C231: 'TR1': redefinition
TIMEZHONGDUAN.C(30): error C231: 'TR0': redefinition
TIMEZHONGDUAN.C(30): error C231: 'TR0': redefinition
TIMEZHONGDUAN.C(32): error C141: syntax error near '}'
timezhongduan.c - 28 Error(s), 0 Warning(s).
TIMEZHONGDUAN.C(30): error C231: 'TR0': redefinition 这个问题已经解决
字母写错 把 unit 函数 改为 init 即可
出现了一个提示
TIMEZHONGDUAN.C(40): warning C276: constant in condition expression
请问这是怎么回事?? 谢谢各位友友
compiling Main.C...
MAIN.C(96): error C141: syntax error near 'void'
MAIN.C(109): error C231: 'spi_open': redefinition
MAIN.C(111): error C231: 'spi_open': redefinition
Main.C - 3 Error(s), 0 Warning(s).