Yep...

I suppose the reason it worked with the quotes with the IAR compiler is because THIS_DEVICE_ADDRESS was in a (IAR) *.dat file not a C header file. To port this I put it in a standard C header.

Thanks,
Paul

On 5/20/2010 4:14 PM, Grant Edwards wrote:
On 2010-05-20, Paul F. Sehorne<[email protected]>  wrote:
I'm portiing the TI Chronos Sports Watch firmware from IAR.  Why would
mspgcc complain "error: invalid initializer"

[code]
// In smpl_config.h (changed smpl_config.dat to a header file)
#define THIS_DEVICE_ADDRESS  "{0x79, 0x56, 0x34, 0x12}"

// In nwk_types.h
typedef struct
{
    uint8_t  addr[NET_ADDR_SIZE];
} addr_t;


// In nwk_globals.c
static const addr_t   sMyROMAddress = THIS_DEVICE_ADDRESS;  // compiler
complains "nwk_globals.c:60: error: invalid initializer"
[/code]
That's because your initializer is a string, and addr_t isn't a
string. It's a structure.


Reply via email to