OttoDIYLib
OttoDIYLib copied to clipboard
EEPROM values should have checksum or tag
When I installed a sample sketch onto a new Nano - with otto.init(true), apparently there was garbage in the EEPROM, which resulted in very tense and weird leg positions.
The EEPROM values should have a tag at the start (say, "OTTO") or a checksum or both. If they don't match, the console should log an error and the values should be discarded.
Hi @anjok Sounds like a good idea how can we implement?
The easiest way would be to write a known start, say OTTO, then 2 bytes of length, then the Len bytes of data and then either a CRC or simply an XOR over the Len data bytes? On read you would check the prefix and the checksum and print an error if they don't match.
The easiest way would be to write a known start, say OTTO, then 2 bytes of length, then the Len bytes of data and then either a CRC or simply an XOR over the Len data bytes? On read you would check the prefix and the checksum and print an error if they don't match.
Cool! can you put that in the code so that we can test?
this has been added to the devel todo list ...