pierrebouchet/Arduino — Issue #1: Improve EEPROMClass
Author: pierrebouchet
Created: 2012-03-07 11:12:28+00:00
State: open

The EEPROM library is really a wrapper for `eeprom_write_byte` and `eeprom_read_byte`.

There are two problems with that:

1. To handle arbitrary-length types one needs to call `EEPROM.read()` or `EEPROM.write()` on each byte. This is raised in issue #178 (http://code.google.com/p/arduino/issues/detail?id=178) and a solution is provided in http://www.arduino.cc/playground/Code/EEPROMWriteAnything. However the AVR EEPROM library already provides efficient block read/writes, so it would make more sense to wrap `eeprom_write_block` and `eeprom_read_block` in `EEPROMClass`

2. In the latest versions of avr-libc there are new optimized EEPROM routines (http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html) that read each byte first and skip the burning if the old value is the same with new. So it would be very useful to have access to `eeprom_update_byte` and `eeprom_update_block` aswell, perhaps via an `EEPROM.update()` method?