|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
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.
小弟初学实在不明白为何有错,尤其是哪个“=”的语法错吴
程序绝对是在英文输入法下完成
求高手指点一下小第感激涕零!!!!
|
|