提示有unrecognized preprocessing directive,几乎每行代码都报错,新手第一次用CCS给MSP430编程,遇到这种情况真是不知道该怎么办才好了
,求大神帮助,下面一楼贴代码
#include
#define FSYNC_1 P2OUT|=BIT3
#define FSYNC_0 P2OUT&=~BIT3
#define SDATA_1 P2OUT|=BIT5
#define SDATA_0 P2OUT&=~BIT5
#define SCLK_1 P2OUT|=BIT4
#define SCLK_0 P2OUT&=~BIT4
#define FCLK 40
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
void Send_Con(uint Con_word)
{
uchar i;
FSYNC_0;
for(i=0;i<16;i++)
{
if(Con_word&0x8000) SDATA_1;
if(!(Con_word&0x8000)) SDATA_0;
Con_word<<=1;
SCLK_0;
SCLK_1;
}
FSYNC_1;
}
void Send_Freq(uint Freq_word)
{
uchar i;
FSYNC_0;
for(i=0;i<16;i++)
{
if(Freq_word&0x8000) SDATA_1;
if(!(Freq_word&0x8000)) SDATA_0;
Freq_word<<=1;
SCLK_0;
SCLK_1;
}
FSYNC_1;
}
void Send_Phase()
{
Send_Con(0xC000);
}
void main()
{
ulong Freq_value=80; //set frequency
ulong value1,value2,Freq_data;
uint LSB_D,MSB_D,i=40000;
P2DIR=0XFF;
WDTCTL = WDTPW + WDTHOLD;
SCLK_1;
FSYNC_1;
if(Freq_value>2000)
Freq_data=Freq_value/1000*6711; //
else
Freq_data=Freq_value*6711/1000;
//
while(i--);
//Freq_data=0x10000;
value1=Freq_data;
value2=Freq_data;
LSB_D=(value1%0x4000)+0x4000; //写FREQ0 REG 的LSB
MSB_D=(value2/0x4000)+0x4000; //写FREQ0 REG 的MSB
Send_Con(0x2028); //DDS初始化设置,IOUT正弦波,SIGNBITOUT方波,一次性写FREQREG0
Send_Freq(LSB_D);
Send_Freq(MSB_D);
while(1);
}
Description Resource Path Location Type
#7 unrecognized token main.c /Project line 16 C/C++ Problem
#7 unrecognized token main.c /Project line 17 C/C++ Problem
#7 unrecognized token main.c /Project line 18 C/C++ Problem
#7 unrecognized token main.c /Project line 19 C/C++ Problem
#7 unrecognized token main.c /Project line 20 C/C++ Problem
#7 unrecognized token main.c /Project line 21 C/C++ Problem
#7 unrecognized token main.c /Project line 22 C/C++ Problem
#7 unrecognized token main.c /Project line 23 C/C++ Problem
#7 unrecognized token main.c /Project line 24 C/C++ Problem
#7 unrecognized token main.c /Project line 25 C/C++ Problem
#7 unrecognized token main.c /Project line 26 C/C++ Problem
#7 unrecognized token main.c /Project line 27 C/C++ Problem
#7 unrecognized token main.c /Project line 28 C/C++ Problem
#7 unrecognized token main.c /Project line 32 C/C++ Problem
#7 unrecognized token main.c /Project line 33 C/C++ Problem
#7 unrecognized token main.c /Project line 34 C/C++ Problem
#7 unrecognized token main.c /Project line 35 C/C++ Problem
#7 unrecognized token main.c /Project line 36 C/C++ Problem
#7 unrecognized token main.c /Project line 37 C/C++ Problem
#7 unrecognized token main.c /Project line 38 C/C++ Problem
#7 unrecognized token main.c /Project line 39 C/C++ Problem
#7 unrecognized token main.c /Project line 40 C/C++ Problem
#7 unrecognized token main.c /Project line 41 C/C++ Problem
#7 unrecognized token main.c /Project line 42 C/C++ Problem
#7 unrecognized token main.c /Project line 44 C/C++ Problem
#7 unrecognized token main.c /Project line 48 C/C++ Problem
#7 unrecognized token main.c /Project line 49 C/C++ Problem
#7 unrecognized token main.c /Project line 50 C/C++ Problem
#7 unrecognized token main.c /Project line 57 C/C++ Problem
#7 unrecognized token main.c /Project line 58 C/C++ Problem
#7 unrecognized token main.c /Project line 59 C/C++ Problem
#7 unrecognized token main.c /Project line 60 C/C++ Problem
#7 unrecognized token main.c /Project line 61 C/C++ Problem
#7 unrecognized token main.c /Project line 62 C/C++ Problem
#7 unrecognized token main.c /Project line 65 C/C++ Problem
#7 unrecognized token main.c /Project line 66 C/C++ Problem
#7 unrecognized token main.c /Project line 67 C/C++ Problem
#7 unrecognized token main.c /Project line 70 C/C++ Problem
#7 unrecognized token main.c /Project line 72 C/C++ Problem
#7 unrecognized token main.c /Project line 74 C/C++ Problem
#7 unrecognized token main.c /Project line 75 C/C++ Problem
#7 unrecognized token main.c /Project line 76 C/C++ Problem
#66 expected a ";" main.c /Project line 16 C/C++ Problem
#171 expected a declaration main.c /Project line 79 C/C++ Problem
#171 expected a declaration main.c /Project line 81 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 4 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 5 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 6 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 7 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 8 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 10 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 11 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 12 C/C++ Problem
#11-D unrecognized preprocessing directive main.c /Project line 13 C/C++ Problem
#93-D identifier-list parameters may only be used in a function definition main.c /Project line 78 C/C++ Problem
#78-D this declaration has no storage class or type specifier main.c /Project line 16 C/C++ Problem
#78-D this declaration has no storage class or type specifier main.c /Project line 78 C/C++ Problem
#12-D parsing restarts here after previous syntax error main.c /Project line 77 C/C++ Problem
有关unrecognized preprocessing directive的报错解决了,可能是因为这是从百度文库里荡的代码,直接复制有问题