From 99f3b8b4a8238bf11ae6ee70c58e3e053abfcffc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Jan 2022 10:14:47 -0600 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Adjust=20LCD=20init,=20con?= =?UTF-8?q?trast=20default,=20settings=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 2 +- Marlin/src/MarlinCore.cpp | 24 ++- Marlin/src/gcode/lcd/M250.cpp | 2 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_post.h | 11 +- Marlin/src/inc/Warnings.cpp | 4 + Marlin/src/lcd/e3v2/creality/dwin.cpp | 3 + Marlin/src/lcd/e3v2/enhanced/dwin.cpp | 3 + Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 4 +- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/marlinui.cpp | 149 +++++++++--------- Marlin/src/lcd/marlinui.h | 29 ++-- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/module/settings.cpp | 44 ++---- Marlin/src/pins/mega/pins_GT2560_REV_A.h | 2 +- Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 2 +- Marlin/src/pins/ramps/pins_K8800.h | 2 +- Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +- 19 files changed, 137 insertions(+), 154 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h index 3ea054589e..8265d58a6e 100644 --- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h @@ -113,7 +113,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o #define _IS_RX1_1 IS_RX1 #if IS_TX1(TMC_SW_SCK) #error "Serial port pins (1) conflict with other pins!" - #elif HAS_WIRED_LCD + #elif HAS_ROTARY_ENCODER #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1) #error "Serial port pins (1) conflict with Encoder Buttons!" #elif ANY_TX(1, SD_SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK_PIN) \ diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 2c29030669..d0065655f1 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1294,16 +1294,7 @@ void setup() { // UI must be initialized before EEPROM // (because EEPROM code calls the UI). - #if HAS_DWIN_E3V2_BASIC - SETUP_RUN(DWIN_Startup()); - #else - SETUP_RUN(ui.init()); - #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN) - SETUP_RUN(ui.show_bootscreen()); - const millis_t bootscreen_ms = millis(); - #endif - SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.) - #endif + SETUP_RUN(ui.init()); #if PIN_EXISTS(SAFE_POWER) #if HAS_DRIVER_SAFE_POWER_PROTECT @@ -1314,10 +1305,6 @@ void setup() { #endif #endif - #if ENABLED(PROBE_TARE) - SETUP_RUN(probe.tare_init()); - #endif - #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION) SETUP_RUN(card.mount()); // Mount media with settings before first_load #endif @@ -1325,6 +1312,15 @@ void setup() { SETUP_RUN(settings.first_load()); // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere + #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN) + SETUP_RUN(ui.show_bootscreen()); + const millis_t bootscreen_ms = millis(); + #endif + + #if ENABLED(PROBE_TARE) + SETUP_RUN(probe.tare_init()); + #endif + #if HAS_ETHERNET SETUP_RUN(ethernet.init()); #endif diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index 25e4232788..58b6dac872 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -31,7 +31,7 @@ * M250: Read and optionally set the LCD contrast */ void GcodeSuite::M250() { - if (parser.seenval('C')) + if (LCD_CONTRAST_MIN < LCD_CONTRAST_MAX && parser.seenval('C')) ui.set_contrast(parser.value_byte()); else M250_report(); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 4386964744..2daa15d0d3 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -237,7 +237,7 @@ #define LCD_HEIGHT 10 // Character lines #define LCD_CONTRAST_MIN 127 #define LCD_CONTRAST_MAX 255 - #define DEFAULT_LCD_CONTRAST 250 + #define LCD_CONTRAST_DEFAULT 250 #define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table. // At this time present conversion only for cyrillic - bg, ru and uk languages. // First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols. diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 5d3ac7a690..734676559c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -376,7 +376,6 @@ #elif EITHER(MKS_MINI_12864_V3, BTT_MINI_12864_V1) #define _LCD_CONTRAST_MIN 255 #define _LCD_CONTRAST_INIT 255 - #define _LCD_CONTRAST_MAX 255 #elif ENABLED(FYSETC_MINI_12864) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) @@ -389,18 +388,12 @@ #elif ENABLED(ZONESTAR_12864OLED) #define _LCD_CONTRAST_MIN 64 #define _LCD_CONTRAST_INIT 128 - #define _LCD_CONTRAST_MAX 255 #elif IS_TFTGLCD_PANEL - #define _LCD_CONTRAST_MIN 0 #define _LCD_CONTRAST_INIT 250 - #define _LCD_CONTRAST_MAX 255 #endif #ifdef _LCD_CONTRAST_INIT #define HAS_LCD_CONTRAST 1 -#endif - -#if HAS_LCD_CONTRAST #ifndef LCD_CONTRAST_MIN #ifdef _LCD_CONTRAST_MIN #define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN @@ -420,8 +413,8 @@ #define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast #endif #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT + #ifndef LCD_CONTRAST_DEFAULT + #define LCD_CONTRAST_DEFAULT LCD_CONTRAST_INIT #endif #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 0d6f9bb134..e1b4a1f9a8 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -559,3 +559,7 @@ #if CANNOT_EMBED_CONFIGURATION #warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override." #endif + +#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX + #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." +#endif diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 03f08ac184..f17d97cc7c 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1834,6 +1834,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) void HMI_SDCardInit() { card.cdroot(); } +// Initialize or re-initialize the LCD +void MarlinUI::init_lcd() { DWIN_Startup(); } + void MarlinUI::refresh() { /* Nothing to see here */ } #if HAS_LCD_BRIGHTNESS diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 484aa392f0..64e90c361e 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -888,6 +888,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) void HMI_SDCardInit() { card.cdroot(); } +// Initialize or re-initialize the LCD +void MarlinUI::init_lcd() { DWIN_Startup(); } + void MarlinUI::refresh() { /* Nothing to see here */ } #if HAS_LCD_BRIGHTNESS diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index eea464dcfd..1356c0e475 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4980,7 +4980,7 @@ void CrealityDWINClass::Reset_Settings() { Redraw_Screen(); } -void MarlinUI::init() { +void MarlinUI::init_lcd() { delay(800); SERIAL_ECHOPGM("\nDWIN handshake "); if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error."); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index b6093784a8..dbf2f7717c 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -79,9 +79,7 @@ void MarlinUI::set_font(const uint8_t font_nr) { bool MarlinUI::detected() { return true; } // Initialize or re-initialize the LCD -void MarlinUI::init_lcd() { - DWIN_Startup(); -} +void MarlinUI::init_lcd() { DWIN_Startup(); } // This LCD should clear where it will draw anew void MarlinUI::clear_lcd() { diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 54e7db55c2..f2763c893f 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1144,7 +1144,7 @@ namespace ExtUI { // At the moment we hook into MarlinUI methods, but this could be cleaned up in the future -void MarlinUI::init() { ExtUI::onStartup(); } +void MarlinUI::init_lcd() { ExtUI::onStartup(); } void MarlinUI::update() { ExtUI::onIdle(); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 2a576f647b..c068082c09 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -43,7 +43,6 @@ MarlinUI ui; #if HAS_DISPLAY #include "../gcode/queue.h" #include "fontutils.h" - #include "../sd/cardreader.h" #endif #if ENABLED(DWIN_CREALITY_LCD) @@ -176,6 +175,77 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif +// Encoder Handling +#if HAS_ENCODER_ACTION + uint32_t MarlinUI::encoderPosition; + volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update +#endif + +void MarlinUI::init() { + + init_lcd(); + + #if HAS_DIGITAL_BUTTONS + #if BUTTON_EXISTS(EN1) + SET_INPUT_PULLUP(BTN_EN1); + #endif + #if BUTTON_EXISTS(EN2) + SET_INPUT_PULLUP(BTN_EN2); + #endif + #if BUTTON_EXISTS(ENC) + SET_INPUT_PULLUP(BTN_ENC); + #endif + #if BUTTON_EXISTS(ENC_EN) + SET_INPUT_PULLUP(BTN_ENC_EN); + #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif + #if BUTTON_EXISTS(UP) + SET_INPUT(BTN_UP); + #endif + #if BUTTON_EXISTS(DWN) + SET_INPUT(BTN_DWN); + #endif + #if BUTTON_EXISTS(LFT) + SET_INPUT(BTN_LFT); + #endif + #if BUTTON_EXISTS(RT) + SET_INPUT(BTN_RT); + #endif + #endif + + #if HAS_SHIFT_ENCODER + + #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register + + SET_OUTPUT(SR_DATA_PIN); + SET_OUTPUT(SR_CLK_PIN); + + #elif PIN_EXISTS(SHIFT_CLK) + + SET_OUTPUT(SHIFT_CLK_PIN); + OUT_WRITE(SHIFT_LD_PIN, HIGH); + #if PIN_EXISTS(SHIFT_EN) + OUT_WRITE(SHIFT_EN_PIN, LOW); + #endif + SET_INPUT_PULLUP(SHIFT_OUT_PIN); + + #endif + + #endif // HAS_SHIFT_ENCODER + + #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS) + slow_buttons = 0; + #endif + + update_buttons(); + + TERN_(HAS_ENCODER_ACTION, encoderDiff = 0); + + reset_status(); // Set welcome message +} + #if HAS_WIRED_LCD #if HAS_MARLINUI_U8GLIB @@ -184,8 +254,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #include "lcdprint.h" - #include "../sd/cardreader.h" - #include "../module/temperature.h" #include "../module/planner.h" #include "../module/motion.h" @@ -247,16 +315,8 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; bool MarlinUI::old_is_printing; #endif - // Encoder Handling - #if HAS_ENCODER_ACTION - uint32_t MarlinUI::encoderPosition; - volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update - #endif - #if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" - #if MARLINUI_SCROLL_NAME uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max; #endif @@ -393,69 +453,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #endif // HAS_LCD_MENU - void MarlinUI::init() { - - init_lcd(); - - #if HAS_DIGITAL_BUTTONS - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - #if BUTTON_EXISTS(ENC_EN) - SET_INPUT_PULLUP(BTN_ENC_EN); - #endif - #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); - #endif - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DWN) - SET_INPUT(BTN_DWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RT); - #endif - #endif - - #if HAS_SHIFT_ENCODER - - #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register - - SET_OUTPUT(SR_DATA_PIN); - SET_OUTPUT(SR_CLK_PIN); - - #elif PIN_EXISTS(SHIFT_CLK) - - SET_OUTPUT(SHIFT_CLK_PIN); - OUT_WRITE(SHIFT_LD_PIN, HIGH); - #if PIN_EXISTS(SHIFT_EN) - OUT_WRITE(SHIFT_EN_PIN, LOW); - #endif - SET_INPUT_PULLUP(SHIFT_OUT_PIN); - - #endif - - #endif // HAS_SHIFT_ENCODER - - #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS) - slow_buttons = 0; - #endif - - update_buttons(); - - TERN_(HAS_ENCODER_ACTION, encoderDiff = 0); - } - //////////////////////////////////////////// ///////////// Keypad Handling ////////////// //////////////////////////////////////////// @@ -629,9 +626,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; next_filament_display = millis() + 5000UL; // Show status message for 5s #endif goto_screen(menu_main); - #if DISABLED(NO_LCD_REINIT) - init_lcd(); // May revive the LCD if static electricity killed it - #endif + IF_DISABLED(NO_LCD_REINIT, init_lcd()); // May revive the LCD if static electricity killed it return; } diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index dcf74b9e27..3217d3531b 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -21,6 +21,7 @@ */ #pragma once +#include "../sd/cardreader.h" #include "../module/motion.h" #include "buttons.h" @@ -30,10 +31,6 @@ #include "../libs/buzzer.h" #endif -#if ENABLED(SDSUPPORT) - #include "../sd/cardreader.h" -#endif - #if ENABLED(TOUCH_SCREEN_CALIBRATION) #include "tft_io/touch_calibration.h" #endif @@ -204,6 +201,20 @@ public: TERN_(HAS_LCD_MENU, currentScreen = status_screen); } + static void init(); + + #if HAS_DISPLAY || HAS_DWIN_E3V2 + static void init_lcd(); + #else + static void init_lcd() {} + #endif + + #if HAS_WIRED_LCD + static bool detected(); + #else + static bool detected() { return true; } + #endif + #if HAS_MULTI_LANGUAGE static uint8_t language; static void set_language(const uint8_t lang); @@ -270,14 +281,6 @@ public: } #endif - #if HAS_WIRED_LCD - static bool detected(); - static void init_lcd(); - #else - static bool detected() { return true; } - static void init_lcd() {} - #endif - #if HAS_PRINT_PROGRESS #if HAS_PRINT_PROGRESS_PERMYRIAD typedef uint16_t progress_t; @@ -365,7 +368,6 @@ public: #if HAS_DISPLAY - static void init(); static void update(); static void abort_print(); @@ -480,7 +482,6 @@ public: #else // No LCD - static void init() {} static void update() {} static void return_to_status() {} diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 4cd43e787a..7642c76710 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -538,7 +538,7 @@ void menu_configuration() { #if HAS_LCD_BRIGHTNESS EDIT_ITEM_FAST(uint8, MSG_BRIGHTNESS, &ui.brightness, LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.refresh_brightness, true); #endif - #if HAS_LCD_CONTRAST + #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif #if ENABLED(FWRETRACT) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index baab8b6dec..90bb9f6d6e 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1965,8 +1965,10 @@ void MarlinSettings::postprocess() { // #if HAS_USER_THERMISTORS { + user_thermistor_t user_thermistor[USER_THERMISTORS]; _FIELD_TEST(user_thermistor); - EEPROM_READ(thermalManager.user_thermistor); + EEPROM_READ(user_thermistor); + if (!validating) COPY(thermalManager.user_thermistor, user_thermistor); } #endif @@ -1974,13 +1976,10 @@ void MarlinSettings::postprocess() { // Power monitor // { - #if HAS_POWER_MONITOR - uint8_t &power_monitor_flags = power_monitor.flags; - #else - uint8_t power_monitor_flags; - #endif + uint8_t power_monitor_flags; _FIELD_TEST(power_monitor_flags); EEPROM_READ(power_monitor_flags); + TERN_(HAS_POWER_MONITOR, if (!validating) power_monitor.flags = power_monitor_flags); } // @@ -1997,7 +1996,6 @@ void MarlinSettings::postprocess() { // LCD Brightness // { - _FIELD_TEST(lcd_brightness); uint8_t lcd_brightness; EEPROM_READ(lcd_brightness); TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.set_brightness(lcd_brightness)); @@ -2007,45 +2005,37 @@ void MarlinSettings::postprocess() { // Controller Fan // { + controllerFan_settings_t cfs = { 0 }; _FIELD_TEST(controllerFan_settings); - #if ENABLED(CONTROLLER_FAN_EDITABLE) - const controllerFan_settings_t &cfs = controllerFan.settings; - #else - controllerFan_settings_t cfs = { 0 }; - #endif EEPROM_READ(cfs); + TERN_(CONTROLLER_FAN_EDITABLE, if (!validating) controllerFan.settings = cfs); } // // Power-Loss Recovery // { + bool recovery_enabled; _FIELD_TEST(recovery_enabled); - #if ENABLED(POWER_LOSS_RECOVERY) - const bool &recovery_enabled = recovery.enabled; - #else - bool recovery_enabled; - #endif EEPROM_READ(recovery_enabled); + TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.enabled = recovery_enabled); } // // Firmware Retraction // { + fwretract_settings_t fwretract_settings; + bool autoretract_enabled; _FIELD_TEST(fwretract_settings); + EEPROM_READ(fwretract_settings); + EEPROM_READ(autoretract_enabled); #if ENABLED(FWRETRACT) - EEPROM_READ(fwretract.settings); - #else - fwretract_settings_t fwretract_settings; - EEPROM_READ(fwretract_settings); - #endif - #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT) - EEPROM_READ(fwretract.autoretract_enabled); - #else - bool autoretract_enabled; - EEPROM_READ(autoretract_enabled); + if (!validating) { + fwretract.settings = fwretract_settings; + TERN_(FWRETRACT_AUTORETRACT, fwretract.autoretract_enabled = autoretract_enabled); + } #endif } diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index 1adf8d3079..ecd341984b 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -127,7 +127,7 @@ #define LCD_RESET_PIN 16 - #define DEFAULT_LCD_CONTRAST 220 + #define LCD_CONTRAST_DEFAULT 220 #define LCD_BACKLIGHT_PIN -1 #else diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 73d4bac472..5c3b1dc9f6 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -134,7 +134,7 @@ #if ENABLED(HJC_LCD_SMART_CONTROLLER) #define LCD_BACKLIGHT_PIN 5 // LCD_Backlight //#ifndef LCD_CONTRAST_PIN - // #define LCD_CONTRAST_PIN 5 // LCD_Contrast + // #define LCD_CONTRAST_PIN 5 // LCD_Contrast //#endif #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN 24 // Filament runout diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 653d317629..5cc4b4323a 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -107,7 +107,7 @@ #define LCD_CONTRAST_MIN 0 #define LCD_CONTRAST_MAX 100 - #define DEFAULT_LCD_CONTRAST 30 + #define LCD_CONTRAST_DEFAULT 30 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #if IS_NEWPANEL diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 6d5928e86d..e6d7c3c20c 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -157,7 +157,7 @@ #define NEOPIXEL_PIN PB9 #endif - #define DEFAULT_LCD_CONTRAST 255 + #define LCD_CONTRAST_DEFAULT 255 #else #define LCD_PINS_RS PC15 #define LCD_PINS_ENABLE PB6