Added CRC check option to fork.
Opened this issue · 0 comments
Hello,
I updated the code in my fork (https://github.com/bzuidgeest/Arduino-EEPROMEx/) to include the functionality from https://github.com/AMPWorks/ArduinoLibs/tree/master/EEPromUtils into this libraries read/write/update block functions. So when writing data to EEPROM it also adds a start byte, records the length being written, and adds a CRC to the end of the data. I added function parameters to switch this behavior on and off.
the old functions are still all there and call the new ones using the new safeWrite parameter to switch off the new functionality.
The specific reason I had for adding these changes is that I want to be able to see if I read valid (initialized) eeprom data. the CRC check allows me to do this. Your library also had has far nicer code than the library I pulled the CRC code from.
I also changed readInt into readInt16 and readLong into readInt32. This is less confusing as the size of int and long differ depending on platform (teensy vs avr)and that might lead to mistakes if you do not look carefully.
If find just creating a pull request presumptuous. I can still do this if you find the changes interesting. I pulled enough code of github. Time to try put something back.
PS C++/github is not my most used language/sourcecontrol system. To me the changes I made look nice enough and seem to work in the tests I did, but I advise looking over the changes carefully.
Let me know.