Settings FIELD_TEST fix

This commit is contained in:
Scott Lahteine 2018-01-05 18:57:54 -06:00
parent 0970dbcdf3
commit 670df2ea6d

View File

@ -330,7 +330,7 @@ void MarlinSettings::postprocess() {
#if ENABLED(DEBUG_EEPROM_READWRITE) #if ENABLED(DEBUG_EEPROM_READWRITE)
#define _FIELD_TEST(FIELD) \ #define _FIELD_TEST(FIELD) \
EEPROM_ASSERT( \ EEPROM_ASSERT( \
eeprom_error || eeprom_index == offsetof(SettingsData, FIELD), \ eeprom_error || eeprom_index == offsetof(SettingsData, FIELD) + EEPROM_OFFSET, \
"Field " STRINGIFY(FIELD) " mismatch." \ "Field " STRINGIFY(FIELD) " mismatch." \
) )
#else #else
@ -388,7 +388,7 @@ void MarlinSettings::postprocess() {
*/ */
bool MarlinSettings::save() { bool MarlinSettings::save() {
float dummy = 0.0f; float dummy = 0.0f;
char ver[4] = "000"; char ver[4] = "ERR";
uint16_t working_crc = 0; uint16_t working_crc = 0;
@ -867,7 +867,7 @@ void MarlinSettings::postprocess() {
// Version has to match or defaults are used // Version has to match or defaults are used
if (strncmp(version, stored_ver, 3) != 0) { if (strncmp(version, stored_ver, 3) != 0) {
if (stored_ver[0] != 'V') { if (stored_ver[3] != '\0') {
stored_ver[0] = '?'; stored_ver[0] = '?';
stored_ver[1] = '\0'; stored_ver[1] = '\0';
} }