Closed ptesarik closed 11 years ago
This is quite clever and definitely can be useful in many cases where EEPROM writes are frequent. Up_n_down, at present, only writes to EEPROM infrequently and probably does not benefit from this.
The cost of this is 374 bytes. This is acceptable for some uses but it should definitely be optional and integrated into the hexbright library.
I recommend that you look into integrating it into the library before we merge. If not, I can probably look into it when I have some spare cycles (in a couple of weeks unfortunately).
OK, I'm leaving it out for now. I will push it again when I rewrite it as a library class.
The original program writes to fixed EEPROM locations, stressing the first two cells only. The modified algorithm distributes the stress across all of the EEPROM memory. It is implemented as follows:
The configuration is read once at startup, and written once before switching off, and only if any values actually changed.