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.
--
Grant Edwards grant.b.edwards Yow! I think my career
at is ruined!
gmail.com