智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 1793|回复: 1
打印 上一主题 下一主题

使用cw写程序的问题,请教!

[复制链接]

6

主题

185

帖子

0

精华

高级会员

Rank: 4

积分
963
威望
435
贡献
438
兑换币
0
注册时间
2010-1-11
在线时间
45 小时
跳转到指定楼层
1#
发表于 2010-3-11 14:15:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
刚刚学用cw环境编程。想编个流水灯程序,但是却有错误,好像意思是语言类错误,提示是:[url=]Tips[/url]
Use a token listed in the error message. Check if you are using the right compiler language option. E.g. you may compile a file with C++ keywords, but are not compiling the file with C++ option set. Too many nested scopes
请高手指教!下面是代码:
#include <hidef.h>      /* common defines and macros */
#include <MC9S12XS128.h>     /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12xs128"
/*sbit pb0=PB0;
sbit pb1=PB1;
sbit _d=DDR  */
#define leddata PORTB
#define led_d DDRB
void delay();
void main(void) {
  /* put your own code here */
  EnableInterrupts;
  
  led_d=0xff;
  leddata=0x00;
  for(;;)
  {   
    delay(150);
    leddata++;
  }
  
}  
void delay(int z) {
  
  int i,j;
  for(i=0;i<150;i++)
     for(j=0;j<z;j++)
}

6

主题

185

帖子

0

精华

高级会员

Rank: 4

积分
963
威望
435
贡献
438
兑换币
0
注册时间
2010-1-11
在线时间
45 小时
2#
 楼主| 发表于 2010-3-11 16:45:30 | 只看该作者
问题已经解决了,原来是在delay延时函数那里少了个分号!呵呵!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-6-18 05:42 , Processed in 0.063876 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表