My project requires that I save a long variable to EEPROM; reading is easy. I just read out to integers (most significant first) and shift this into the tempoary long variable. I optimised this to work with just one long variable:
long TempLong; TempLong = eeprom_read_word(Addr); Templong<<= 16; TempLong |= eeprom_read_word(Addr + 2);
...At least I HOPE thats how it should work. The problem i'm having is with writing; how do I do this? I can shift the long 16 right and typecast it to an int to get the most significant int into EEPROM, but how do I do the lower int? I assume you just mask it off, like "TempLong & 0xFFFF".
- Dean :twisted:[/code]