error: declaration may not appear after executable statement in block
2012-07-17 09:08
597 查看
在CCS中:
typedef struct {
Uint32 gblctl;
Uint32 cectl0;
Uint32 cectl1;
Uint32 cectl2;
Uint32 cectl3;
Uint32 sdctl;
Uint32 sdtim;
Uint32 sdext;
Uint32 cesec0;
Uint32 cesec1;
Uint32 cesec2;
Uint32 cesec3;
} EMIFA_Config;
void main()
{
*GPEN = 0x000026f0 ;
*GPDIR = 0x00002600 ;
EMIFA_Config emifaCfg0 = {
0x000520C4, /* Global Control Reg. (GBLCTL) */
0x44148444, /* CE0 Space Control Reg. (CECTL0) *///0x2172c523 //0x000520A4,
0x2172c543, /* C1 Space Control Reg. (CECTL1) */
0xFFFFFF23, /* CE2 Space Control Reg. (CECTL2) */
0xFFFFFF23, /* CE3 Space Control Reg. (CECTL3) */
0x0348F000, /* SDRAM Control Reg.(SDCTL) */
0x005DC5DC, /* SDRAM Timing Reg.(SDTIM) */
0x00175F3F, /* SDRAM Extended Reg.(SDEXT) */
0x00000063, /* CE0 Space Secondary Control Reg. (CESEC0) */
0x00000063, /* CE1 Space Secondary Control Reg. (CESEC1) */ //0x00000060
0x00000002, /* CE2 Space Secondary Control Reg. (CESEC2) */
0x00000002 /* CE3 Space Secondary Control Reg. (CESEC3) */
};
}
好像是因为没有声明就开始使用EMIFA_Config这个变量了,该怎么解决呢? 大家可以集思广益!
typedef struct {
Uint32 gblctl;
Uint32 cectl0;
Uint32 cectl1;
Uint32 cectl2;
Uint32 cectl3;
Uint32 sdctl;
Uint32 sdtim;
Uint32 sdext;
Uint32 cesec0;
Uint32 cesec1;
Uint32 cesec2;
Uint32 cesec3;
} EMIFA_Config;
void main()
{
*GPEN = 0x000026f0 ;
*GPDIR = 0x00002600 ;
EMIFA_Config emifaCfg0 = {
0x000520C4, /* Global Control Reg. (GBLCTL) */
0x44148444, /* CE0 Space Control Reg. (CECTL0) *///0x2172c523 //0x000520A4,
0x2172c543, /* C1 Space Control Reg. (CECTL1) */
0xFFFFFF23, /* CE2 Space Control Reg. (CECTL2) */
0xFFFFFF23, /* CE3 Space Control Reg. (CECTL3) */
0x0348F000, /* SDRAM Control Reg.(SDCTL) */
0x005DC5DC, /* SDRAM Timing Reg.(SDTIM) */
0x00175F3F, /* SDRAM Extended Reg.(SDEXT) */
0x00000063, /* CE0 Space Secondary Control Reg. (CESEC0) */
0x00000063, /* CE1 Space Secondary Control Reg. (CESEC1) */ //0x00000060
0x00000002, /* CE2 Space Secondary Control Reg. (CESEC2) */
0x00000002 /* CE3 Space Secondary Control Reg. (CESEC3) */
};
}
好像是因为没有声明就开始使用EMIFA_Config这个变量了,该怎么解决呢? 大家可以集思广益!
相关文章推荐
- error: declaration may not appear after executable statement in block
- error: declaration may not appear after executable statement in block
- error: declaration may not appear after executable statement in block
- KeilMDK 编译报错:error: #268: declaration may not appear after executable statement in block
- 【complier】error: #268: declaration may not appear after executable statement in block
- stm32:error: #268: declaration may not appear after executable statement in block
- keil中变量声明问题及error: #268: declaration may not appear after executable statement in block
- declaration may not appear after executable statement in block
- #268: declaration may not appear after executable statement in block 另类错误原因
- declaration may not appear after executable statement in block
- declaration may not appear after executable statement in block
- #268: declaration may not appear after executable statement in block
- error: #268: declaration may not appear after executabl statement in block
- declaration may not appear after executable statement in block
- 搞定error: #268: declaration may not appear after executable statement
- 使用Keil-STM32,cmsis_os.c 出现 error: #268: declaration may not appear after executable....
- SQL Error:An aggregate may not appear in the set list of an UPDATE statement.
- ARMCC: Error #268: declaration may not appear after executable state
- Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in
- Sharepoint Error : The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web