新浪博客

[转载]illegal statement termination

2011-12-14 20:07阅读:


我用labwindows/cvi写程序也出现了这样的问题,呵呵。

原文作者:lightrain

illegal statement termination
今天在调试程序时,遇到了一个很弱智的问题,出错提示是:illegal statement termination
void main(void)
{
init_devices(); //初始化
uint j; ##出错位置
uchar temp=0xFE; ##出错位置
while(1)
{
for(j=1;j<=8;j++){
PORTC = 0x00; //1脚为高,0脚为低,0脚灯亮
Delay(); //延时
PORTC = 0xFF; //0脚为高,1脚为低,1脚灯亮
Delay(); //延时
}
for(j=1;j<=8;j++){
PORTC=temp;

Delay();
temp=PINC<<1;
}
}
}
上网查了一下,得到如下结果:
[转载]illegal <wbr>statement <wbr>termination
[转载]illegal <wbr>statement <wbr>termination
然后我就做了改正。就通过编译了。
void main(void)
{
uint j;
uchar temp=0xFE;
init_devices(); //初始化
while(1)
{
for(j=1;j<=8;j++){
PORTC = 0x00; //1脚为高,0脚为低,0脚灯亮
Delay(); //延时
PORTC = 0xFF; //0脚为高,1脚为低,1脚灯亮
Delay(); //延时
}
for(j=1;j<=8;j++){
PORTC=temp;
Delay();
temp=PINC<<1;
}
}
}


我的更多文章

下载客户端阅读体验更佳

APP专享