Hello,
I think, ...
Declaration's of eeprom_read_byte (const uint8_t *addr) look wrong with tionuint8 (BYTE) for type of addr.
I have made some functions to read/write from/to eeprom.
void eeprom_wr_byte (unsigned int const * ptr, byte val)
{
register byte sreg;
sreg = SREG;
cli();
while ( EECR & (1 << EEWE )) {
SREG = sreg;
cli ();
}
EEAR = (unsigned int)ptr;
EEDR = val;
EECR |= ( 1 << EEMWE );
EECR |= ( 1 << EEWE );
SREG = sreg;
}
void eeprom_wr_word (unsigned int const * ptr, unsigned int val)
{
unsigned int uiTmp = (unsigned int)ptr;
byte bH = (val >> 8) & 0xFF;
byte bL = val & 0xFF;
eeprom_wr_byte ((unsigned int *)uiTmp, bL);
uiTmp++;
eeprom_wr_byte ((unsigned int *)uiTmp, bH);
}