This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR 247 "non-address/-constant initializer"

Hi there,

I'm using the C51 compiler version 5.5. I'm trying to use the following construct:

#define SYSPTR_LOCAL_CODE 0x40
#define MM0MNDEF_BANK 0x02

const char Str[] = "STRING";

typedef struct
{
byte bType;
byte bHighO;
byte bLowO;
} MakeSysPtr;

#define MakeSysPtr_I( T, B, O ) { ( T | B ), ((word)O >> 8), ((word)O & 0x0FF) }

typedef struct
{
byte bKeys;
MakeSysPtr sLeft;
} MakeKeyDef_T;

const MakeKeyDef_T KEY_DEF =
{
ALL_SOFT_KEYS,
MakeSysPtr_I( SYSPTR_LOCAL_CODE, MM0MNDEF_BANK, Str )
};
The compiler generates the the error message listed in the summary on the line were we use the MakeSysPtr_I ( initializer for the MakeSysPtr structure ). Could someone point out why we're getting this error. I have no problems compiling this piece of code with Visual C or ARM compilers.

Thanks,
Doru.

0