Return 'false' on EEPROM connection fail (#14776)

2.0.x
Eric Ptak 5 years ago committed by Scott Lahteine
parent 128eed6b57
commit fdbc733376

@ -460,7 +460,8 @@ void MarlinSettings::postprocess() {
#define EEPROM_SKIP(VAR) (eeprom_index += sizeof(VAR))
#endif
#define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start()
#define EEPROM_START() if (!persistentStore.access_start()) { SERIAL_ECHO_MSG("No EEPROM."); return false; } \
int eeprom_index = EEPROM_OFFSET
#define EEPROM_FINISH() persistentStore.access_finish()
#define EEPROM_WRITE(VAR) do{ persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc); UPDATE_TEST_INDEX(VAR); }while(0)
#define EEPROM_READ(VAR) do{ persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating); UPDATE_TEST_INDEX(VAR); }while(0)
@ -2111,7 +2112,7 @@ void MarlinSettings::postprocess() {
(void)save();
SERIAL_ECHO_MSG("EEPROM Initialized");
#endif
return true;
return false;
}
#if ENABLED(AUTO_BED_LEVELING_UBL)

Loading…
Cancel
Save