Writes the data to eeprom, reads it back and compares it to the original data. It returns true if the argument and the read-back data are the same, false otherwise.
In other words, true meanse "write successful", false means "write failed. eeprom probably corrupt".
template <class T> boolean EEPROM_writeVerifyAnything(int ee, const T& value)
{
T aux;
EEPROM_writeAnything(ee, value);
EEPROM_readAnything(ee, aux);
return memcmp((const byte*)&value, (const byte*)&aux, sizeof(T)) == 0;
}
Comments are welcome. :-)