Improved EEPROM boot error (#17916)

This commit is contained in:
Scott Lahteine
2020-05-10 00:12:56 -05:00
committed by GitHub
parent 91fe0e1022
commit 52aa459a2d
13 changed files with 125 additions and 106 deletions

View File

@ -34,10 +34,6 @@
#include "../../libs/buzzer.h"
#endif
#if ENABLED(EEPROM_SETTINGS)
#include "../../module/configuration_store.h"
#endif
#if WATCH_HOTENDS || WATCH_BED
#include "../../module/temperature.h"
#endif
@ -228,7 +224,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
if (on_status_screen())
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
}
else if (screen == status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) {
else if (on_status_screen() && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) {
if ( (ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_known())
&& (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy()) )
screen = TERN(BABYSTEP_ZPROBE_OFFSET, lcd_babystep_zoffset, lcd_babystep_z);
@ -245,7 +241,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
encoderPosition = encoder;
encoderTopLine = top;
screen_items = items;
if (screen == status_screen) {
if (on_status_screen()) {
defer_status_screen(false);
TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false);
screen_history_depth = 0;
@ -256,7 +252,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
// Re-initialize custom characters that may be re-used
#if HAS_CHARACTER_LCD
if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control))
set_custom_characters(screen == status_screen ? CHARSET_INFO : CHARSET_MENU);
set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
#endif
refresh(LCDVIEW_CALL_REDRAW_NEXT);
@ -383,11 +379,6 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
#endif // BABYSTEP_ZPROBE_OFFSET
#if ENABLED(EEPROM_SETTINGS)
void lcd_store_settings() { ui.completion_feedback(settings.save()); }
void lcd_load_settings() { ui.completion_feedback(settings.load()); }
#endif
void _lcd_draw_homing() {
constexpr uint8_t line = (LCD_HEIGHT - 1) / 2;
if (ui.should_draw()) MenuItem_static::draw(line, GET_TEXT(MSG_LEVEL_BED_HOMING));
@ -416,6 +407,7 @@ void MenuItem_confirm::select_screen(PGM_P const yes, PGM_P const no, selectFunc
if (got_click || ui.should_draw()) {
draw_select_screen(yes, no, ui_selection, pref, string, suff);
if (got_click) { ui_selection ? yesFunc() : noFunc(); }
ui.defer_status_screen();
}
}

View File

@ -589,11 +589,6 @@ void _lcd_draw_homing();
#endif
#endif
#if ENABLED(EEPROM_SETTINGS)
void lcd_store_settings();
void lcd_load_settings();
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
void menu_job_recovery();
#endif

View File

@ -47,7 +47,7 @@
#include "../../feature/runout.h"
#endif
#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
#if ENABLED(SD_FIRMWARE_UPDATE)
#include "../../module/configuration_store.h"
#endif
@ -97,10 +97,6 @@ void menu_cancelobject();
#endif
#if ENABLED(SD_FIRMWARE_UPDATE)
#include "../../module/configuration_store.h"
#endif
#if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
//
// Advanced Settings > Filament
@ -591,13 +587,8 @@ void menu_advanced_settings() {
#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
CONFIRM_ITEM(MSG_INIT_EEPROM,
MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
[]{
const bool inited = settings.init_eeprom();
ui.completion_feedback(inited);
UNUSED(inited);
},
ui.goto_previous_screen,
GET_TEXT(MSG_INIT_EEPROM), (PGM_P)nullptr, PSTR("?")
ui.init_eeprom, ui.goto_previous_screen,
GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?")
);
#endif

View File

@ -86,7 +86,7 @@ static inline void _lcd_level_bed_corners_homing() {
ui.goto_previous_screen_no_defer();
}
, GET_TEXT(TERN(LEVEL_CENTER_TOO, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
, (PGM_P)nullptr, PSTR("?")
, (const char*)nullptr, PSTR("?")
);
});
ui.set_selection(true);

View File

@ -279,8 +279,8 @@ void menu_bed_leveling() {
#endif
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings);
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
#endif
END_MENU();
}

View File

@ -30,8 +30,6 @@
#include "menu.h"
#include "../../module/configuration_store.h"
#if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h"
#endif
@ -174,7 +172,7 @@ void menu_advanced_settings();
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets);
EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Z, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets);
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
#endif
END_MENU();
}
@ -335,7 +333,7 @@ void menu_advanced_settings();
EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAX_TARGET);
#endif
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
#endif
END_MENU();
}
@ -439,12 +437,11 @@ void menu_configuration() {
#endif
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
#endif
if (!busy)
ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); ui.completion_feedback(); });
if (!busy) ACTION_ITEM(MSG_RESTORE_DEFAULTS, ui.reset_settings);
END_MENU();
}

View File

@ -126,8 +126,8 @@ void menu_delta_calibrate() {
#if ENABLED(DELTA_AUTO_CALIBRATION)
GCODES_ITEM(MSG_DELTA_AUTO_CALIBRATE, PSTR("G33"));
#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings);
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
#endif
#endif

View File

@ -103,7 +103,7 @@ void menu_main() {
MenuItem_confirm::select_screen(
GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK),
ui.abort_print, ui.goto_previous_screen,
GET_TEXT(MSG_STOP_PRINT), (PGM_P)nullptr, PSTR("?")
GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?")
);
});
#endif

View File

@ -265,7 +265,7 @@ void menu_mixer() {
ui.return_to_status();
},
ui.goto_previous_screen,
GET_TEXT(MSG_RESET_VTOOLS), (PGM_P)nullptr, PSTR("?")
GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?")
);
#if ENABLED(GRADIENT_MIX)