Error : (Serious) C2857E: #include file "config.h" wouldn't open
uint32.c line 2
Error : C2285E: expected ';' or ',' - inserted ';' before 'DISP_TAB'
uint32.c line 4
Error : C2225W: declaration lacks type/storage-class (assuming 'int'): 'DISP_TAB'
uint32.c line 4
Error : C2285E: expected ')' or ',' - inserted ')' before 'dly'
uint32.c line 6
Error : C2470E: function prototype formal 'uint32' needs type or class - 'int' assumed
uint32.c line 6
Error : C2285E: expected ';' or ',' - inserted ';' before 'dly'
uint32.c line 6
Error : C2225W: declaration lacks type/storage-class (assuming 'int'): 'dly'
uint32.c line 6
Error : C2285E: expected ';' or ',' - inserted ';' before ')'
uint32.c line 6
Error : (Serious) C2322E: Expecting <declarator> or <type> but found ')'
uint32.c line 6
Error : C2285E: expected ';' or ',' - inserted ';' before '{'
uint32.c line 7
Error : (Serious) C2337E: Misplaced '{' at top level - ignoring block
uint32.c line 7
Warning : C2917W: no side effect in void context: 'uint32'
uint32.c line 8
Error : (Serious) C2284E: expected ';' after command - inserted before 'i'
uint32.c line 8
Error : C2456E: undeclared name, inventing 'extern int i'
uint32.c line 8
Warning : C2917W: no side effect in void context: 'i'
uint32.c line 8
Error : C2456E: undeclared name, inventing 'extern int T0PR'
uint32.c line 17
Error : C2456E: undeclared name, inventing 'extern int T0MCR'
uint32.c line 18
Error : C2456E: undeclared name, inventing 'extern int T0MR0'
uint32.c line 19
Error : C2456E: undeclared name, inventing 'extern int T0TCR'
uint32.c line 20
Warning : C2917W: no side effect in void context: 'uint32'
uint32.c line 26
Error : (Serious) C2284E: expected ';' after command - inserted before 'j'
uint32.c line 26
Error : C2456E: undeclared name, inventing 'extern int j'
uint32.c line 26
Warning : C2917W: no side effect in void context: 'j'
uint32.c line 26
Error : C2456E: undeclared name, inventing 'extern int PINSEL0'
uint32.c line 27
Error : C2456E: undeclared name, inventing 'extern int IO0DIR'
uint32.c line 28
Error : C2456E: undeclared name, inventing 'extern int IO2DIR'
uint32.c line 29
Error : C2456E: undeclared name, inventing 'extern int IO0SET'
uint32.c line 31
Error : C2456E: undeclared name, inventing 'extern int IO2SET'
uint32.c line 32
Error : C2456E: undeclared name, inventing 'extern int T0IR'
uint32.c line 38
Error : C2456E: undeclared name, inventing 'extern int IO2CLR'
uint32.c line 40
Error : C2456E: undeclared name, inventing 'extern int IO0CLR'
uint32.c line 49
D:\Documents\uint32\uint32.c: 4 warnings, 22 errors, 5 serious errors
请问这是什么错误?源码如下
#include "config.h"
#define LEDCON 0xf0000000
#define BEEPCON 1<<7
const uint32 DISP_TAB[4]={0x1fffffff,0x2fffffff,0x4fffffff,0x8fffffff};
/**********************延时*****************************************************************************/
void DelayNS(uint32 dly)
{
uint32 i;
for(;dly>0;dly--)
{
for(i=0;i<500;i++);
}
}
/******************************初始化定时器*************************************************************/
void Time0Init(void)
{
T0PR=99;
T0MCR=0x03;
T0MR0=110592;
T0TCR=0x03;
T0TCR=0x01;
}
/******************************主函数******************************************************************/
int main(void)
{
PINSEL0=0x00000000;
IO0DIR=BEEPCON; /*****************配置P0.7为输入************************************/
IO2DIR=LEDCON; /*****************配置4个LED为输入**********************************/
Time0Init(); /*****************初始化定时器0************************************/
IO0SET=BEEPCON; /*****************配置P0.7为高电平*********************************/
IO2SET=LEDCON; /*****************配置LED,使其不亮********************************/
uint32 j;
while(1)
{
for(j=0;j<60;j++)
{
while((T0IR&0x01)==0)
T0IR=0x01;
IO2CLR=DISP_TAB[j%4];
DelayNS(2);
IO2SET=0xffffffff;
}
for(j=0;j<5;j++)
{
while((T0IR&0x01)==0)
T0IR=0x01;
IO2CLR=0xffffffff;
IO0CLR=BEEPCON;
DelayNS(2);
IO2SET=0xffffffff;
IO0SET=BEEPCON;
}
}
return(0);
} |