Add MarlinSettings::validate()

This commit is contained in:
Scott Lahteine
2018-01-04 19:51:18 -06:00
parent 878f54c27b
commit 51e0f2bee3
12 changed files with 192 additions and 138 deletions

View File

@ -38,10 +38,10 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
return false;
}
bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) {
bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((unsigned char*)pos);
*value = c;
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
value++;