在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2140|回复: 0

[原创] 求救!!!高手来指点小弟一下!先作揖了!!

[复制链接]
发表于 2007-2-2 21:57:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 cjsb37 于 2013-4-29 09:10 编辑

#include"register.h"
void initial(void)
{
asm("setc SXM");
asm("clrc OVM");
asm("clrc CNF");
asm("setc INTM");
  *SCSR1=0x81FE;
  *WDCR=0x0E8;
  *IMR=0x0000;
  *IFR=0x0FFFF;
  *MCRA=*MCRA&0x0FF;
  *PBDATDIR=*PBDATDIR|0x0FF00;
  *MCRC=*MCRC&0X0FBFF;
  *PBDATDIR=*PBDATDIR&0X0FF00;
  *PFDATDIR=*PFDATDIR|0X0404;
  *PEDATDIR=*PFDATDIR&0X0FFFB;
}
main()
{
int led;
int i;
int k;
intial();
while(1)            
{
for(led=0x0080,i=0;i<8;led=led>>1,i++)
    {
    *PBDATDIR=*PBDATDIR&0x0ff00;
    *PBDATDIR=*PBDATDIR|led;
    *PFDATDIR=*PFDATDIR|0x0404;
    *PFDATDIR=*PFDATDIR&0x0fffb;
    for(k=0;k<0x0ffff;k++)
    k=k;
    }
}
}
/**********************************/
void interrupt nothing()
{
return;
}
编译结果
dspcl IO.C -g -v2xx -as -frC:\tic2xx\myprojects\IO
[IO.C]
TMS320C2x/C2xx/C5x ANSI C Compiler          Version 7.00
Copyright (c) 1987-1999  Texas Instruments Incorporated
   "IO.C"   ==> initial
"IO.C", line 9: [F022] illegal constant
"IO.C", line 9: [F001] syntax error at or near symbol '='
"IO.C", line 10: [F001] syntax error at or near symbol '='
"IO.C", line 11: [F108] 'Int' undefined
"IO.C", line 12: [F022] illegal constant
"IO.C", line 12: [F001] syntax error at or near symbol '='
"IO.C", line 13: [F022] illegal constant
"IO.C", line 13: [F001] syntax error at or near symbol '='
"IO.C", line 13: [F137] operand of '&' must be an object or function
"IO.C", line 14: [F022] illegal constant
"IO.C", line 14: [F001] syntax error at or near symbol '='
"IO.C", line 15: [F022] illegal constant
"IO.C", line 15: [F001] syntax error at or near symbol '='
"IO.C", line 15: [F137] operand of '&' must be an object or function
"IO.C", line 16: [F001] syntax error at or near symbol '='
"IO.C", line 16: [F137] operand of '&' must be an object or function
"IO.C", line 17: [F022] illegal constant
"IO.C", line 17: [F001] syntax error at or near symbol '='
"IO.C", line 18: [F022] illegal constant
"IO.C", line 18: [F001] syntax error at or near symbol '='
"IO.C", line 18: [F137] operand of '&' must be an object or function
   "IO.C"   ==> main
"IO.C", line 30: [F001] syntax error at or near symbol '='
"IO.C", line 30: [F137] operand of '&' must be an object or function
"IO.C", line 31: [F001] syntax error at or near symbol '='
"IO.C", line 32: [F001] syntax error at or near symbol '='
"IO.C", line 33: [F001] syntax error at or near symbol '='
"IO.C", line 33: [F137] operand of '&' must be an object or function
   "IO.C"   ==> nothing
Compile Complete,
  27 Errors, 0 Warnings.
小弟初学实在不明白为何有错,尤其是哪个“=”的语法错吴
程序绝对是在英文输入法下完成
求高手指点一下小第感激涕零!!!!





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

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-3-8 20:06 , Processed in 0.016394 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表