Merge pull request #9001 from Tannoo/(2.0.x)_LCD_EEPROM_init_fix
[2.0.x] EEPROM init fix
This commit is contained in:
commit
724e3f33bc
2 changed files with 16 additions and 2 deletions
|
@ -3209,8 +3209,7 @@ void kill_screen(const char* lcd_msg) {
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
|
|
||||||
static void lcd_init_eeprom() {
|
static void lcd_init_eeprom() {
|
||||||
lcd_factory_settings();
|
lcd_completion_feedback(settings.init_eeprom());
|
||||||
settings.save();
|
|
||||||
lcd_goto_previous_menu();
|
lcd_goto_previous_menu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,21 @@ class MarlinSettings {
|
||||||
static void reset();
|
static void reset();
|
||||||
static bool save();
|
static bool save();
|
||||||
|
|
||||||
|
FORCE_INLINE static bool init_eeprom() {
|
||||||
|
bool success = true;
|
||||||
|
reset();
|
||||||
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
|
if ((success = save())) {
|
||||||
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
|
success = load(); // UBL uses load() to know the end of EEPROM
|
||||||
|
#elif ENABLED(EEPROM_CHITCHAT)
|
||||||
|
report();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
static bool load();
|
static bool load();
|
||||||
|
|
||||||
|
|
Reference in a new issue