Seems I've learnt the hard way yet again...
I have been using ICC for megas but I've switched over to AtmelStudio (6.1|2) to make use of the xmega devices. Seems the order the compilers stuffs variables into EEPROM is reversed. e.g.
In ICC I do the following:
#pragma data:eeprom unsigned char EE_sBaud = 4; unsigned char EE_sAddr = 1; Gain_Val EE_sf = G8; #pragma data:data
and i get the .eep file:
Now in AtmelStudio I do the following:
unsigned char EEMEM EE_sBaud = 4; unsigned char EEMEM EE_sAddr = 1; Gain_Val EEMEM EE_sf = G8;
with the corresponding .eep file contents:
The data bytes 04,01,03 (G8 = 03) have been put into EEPROM in the same order they appear in the file for ICC but in the reverse order for GCC.
Is this just the way things are normally for GCC? Is there a setting in Atmel Studio to force the order?