1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 13:25:54 +00:00

🚸 EEPROM reset messages

This commit is contained in:
Scott Lahteine 2024-10-13 20:08:53 -05:00
parent 282f90c1b3
commit 81760d6818
3 changed files with 12 additions and 2 deletions

View File

@ -191,6 +191,7 @@
#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold"
#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!"
#define STR_ERR_EEPROM_CORRUPT "EEPROM Corrupt"
#define STR_EEPROM_INITIALIZED "EEPROM Initialized"
#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
#define STR_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"

View File

@ -496,6 +496,7 @@ namespace LanguageNarrow_en {
LSTR MSG_LOAD_EEPROM = _UxGT("Load Settings");
LSTR MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults");
LSTR MSG_INIT_EEPROM = _UxGT("Initialize EEPROM");
LSTR MSG_EEPROM_INITIALIZED = _UxGT("EEPROM Initialized");
LSTR MSG_ERR_EEPROM_CRC = _UxGT("Err: EEPROM CRC");
LSTR MSG_ERR_EEPROM_SIZE = _UxGT("Err: EEPROM Size");
LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Err: EEPROM Version");
@ -1098,6 +1099,7 @@ namespace LanguageWide_en {
LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time");
LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total");
LSTR MSG_HOMING_FEEDRATE_N = _UxGT("@ Homing Feedrate");
LSTR MSG_EEPROM_INITIALIZED = _UxGT("Default Settings Restored");
#endif
}

View File

@ -3100,17 +3100,24 @@ void MarlinSettings::postprocess() {
#endif // HAS_EARLY_LCD_SETTINGS
bool MarlinSettings::load() {
// If the EEPROM data is valid load it
if (validate()) {
const EEPROM_Error err = _load();
const bool success = (err == ERR_EEPROM_NOERR);
TERN_(EXTENSIBLE_UI, ExtUI::onSettingsLoaded(success));
return success;
}
// Otherwise reset settings to default "factory settings"
reset();
// Options to overwrite the EEPROM on error
#if ANY(EEPROM_AUTO_INIT, EEPROM_INIT_NOW)
(void)save();
SERIAL_ECHO_MSG("EEPROM Initialized");
(void)init_eeprom();
LCD_MESSAGE(MSG_EEPROM_INITIALIZED);
SERIAL_ECHO_MSG(STR_EEPROM_INITIALIZED);
#endif
return false;
}