Selaa lähdekoodia

♻️ Adjust LCD init, contrast default, settings load

Scott Lahteine 2 vuotta sitten
vanhempi
commit
d5f2334140

+ 1
- 1
Marlin/src/HAL/LPC1768/inc/SanityCheck.h Näytä tiedosto

@@ -113,7 +113,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
113 113
   #define _IS_RX1_1 IS_RX1
114 114
   #if IS_TX1(TMC_SW_SCK)
115 115
     #error "Serial port pins (1) conflict with other pins!"
116
-  #elif HAS_WIRED_LCD
116
+  #elif HAS_ROTARY_ENCODER
117 117
     #if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
118 118
       #error "Serial port pins (1) conflict with Encoder Buttons!"
119 119
     #elif ANY_TX(1, SD_SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK_PIN) \

+ 10
- 14
Marlin/src/MarlinCore.cpp Näytä tiedosto

@@ -1294,16 +1294,7 @@ void setup() {
1294 1294
   // UI must be initialized before EEPROM
1295 1295
   // (because EEPROM code calls the UI).
1296 1296
 
1297
-  #if HAS_DWIN_E3V2_BASIC
1298
-    SETUP_RUN(DWIN_Startup());
1299
-  #else
1300
-    SETUP_RUN(ui.init());
1301
-    #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN)
1302
-      SETUP_RUN(ui.show_bootscreen());
1303
-      const millis_t bootscreen_ms = millis();
1304
-    #endif
1305
-    SETUP_RUN(ui.reset_status());     // Load welcome message early. (Retained if no errors exist.)
1306
-  #endif
1297
+  SETUP_RUN(ui.init());
1307 1298
 
1308 1299
   #if PIN_EXISTS(SAFE_POWER)
1309 1300
     #if HAS_DRIVER_SAFE_POWER_PROTECT
@@ -1314,10 +1305,6 @@ void setup() {
1314 1305
     #endif
1315 1306
   #endif
1316 1307
 
1317
-  #if ENABLED(PROBE_TARE)
1318
-    SETUP_RUN(probe.tare_init());
1319
-  #endif
1320
-
1321 1308
   #if BOTH(SDSUPPORT, SDCARD_EEPROM_EMULATION)
1322 1309
     SETUP_RUN(card.mount());          // Mount media with settings before first_load
1323 1310
   #endif
@@ -1325,6 +1312,15 @@ void setup() {
1325 1312
   SETUP_RUN(settings.first_load());   // Load data from EEPROM if available (or use defaults)
1326 1313
                                       // This also updates variables in the planner, elsewhere
1327 1314
 
1315
+  #if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN)
1316
+    SETUP_RUN(ui.show_bootscreen());
1317
+    const millis_t bootscreen_ms = millis();
1318
+  #endif
1319
+
1320
+  #if ENABLED(PROBE_TARE)
1321
+    SETUP_RUN(probe.tare_init());
1322
+  #endif
1323
+
1328 1324
   #if HAS_ETHERNET
1329 1325
     SETUP_RUN(ethernet.init());
1330 1326
   #endif

+ 1
- 1
Marlin/src/gcode/lcd/M250.cpp Näytä tiedosto

@@ -31,7 +31,7 @@
31 31
  * M250: Read and optionally set the LCD contrast
32 32
  */
33 33
 void GcodeSuite::M250() {
34
-  if (parser.seenval('C'))
34
+  if (LCD_CONTRAST_MIN < LCD_CONTRAST_MAX && parser.seenval('C'))
35 35
     ui.set_contrast(parser.value_byte());
36 36
   else
37 37
     M250_report();

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Näytä tiedosto

@@ -237,7 +237,7 @@
237 237
   #define LCD_HEIGHT                  10    // Character lines
238 238
   #define LCD_CONTRAST_MIN            127
239 239
   #define LCD_CONTRAST_MAX            255
240
-  #define DEFAULT_LCD_CONTRAST        250
240
+  #define LCD_CONTRAST_DEFAULT        250
241 241
   #define CONVERT_TO_EXT_ASCII        // Use extended 128-255 symbols from ASCII table.
242 242
                                       // At this time present conversion only for cyrillic - bg, ru and uk languages.
243 243
                                       // First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols.

+ 2
- 9
Marlin/src/inc/Conditionals_post.h Näytä tiedosto

@@ -376,7 +376,6 @@
376 376
 #elif EITHER(MKS_MINI_12864_V3, BTT_MINI_12864_V1)
377 377
   #define _LCD_CONTRAST_MIN  255
378 378
   #define _LCD_CONTRAST_INIT 255
379
-  #define _LCD_CONTRAST_MAX  255
380 379
 #elif ENABLED(FYSETC_MINI_12864)
381 380
   #define _LCD_CONTRAST_INIT 220
382 381
 #elif ENABLED(ULTI_CONTROLLER)
@@ -389,18 +388,12 @@
389 388
 #elif ENABLED(ZONESTAR_12864OLED)
390 389
   #define _LCD_CONTRAST_MIN   64
391 390
   #define _LCD_CONTRAST_INIT 128
392
-  #define _LCD_CONTRAST_MAX  255
393 391
 #elif IS_TFTGLCD_PANEL
394
-  #define _LCD_CONTRAST_MIN    0
395 392
   #define _LCD_CONTRAST_INIT 250
396
-  #define _LCD_CONTRAST_MAX  255
397 393
 #endif
398 394
 
399 395
 #ifdef _LCD_CONTRAST_INIT
400 396
   #define HAS_LCD_CONTRAST 1
401
-#endif
402
-
403
-#if HAS_LCD_CONTRAST
404 397
   #ifndef LCD_CONTRAST_MIN
405 398
     #ifdef _LCD_CONTRAST_MIN
406 399
       #define LCD_CONTRAST_MIN _LCD_CONTRAST_MIN
@@ -420,8 +413,8 @@
420 413
       #define LCD_CONTRAST_MAX 63   // ST7567 6-bits contrast
421 414
     #endif
422 415
   #endif
423
-  #ifndef DEFAULT_LCD_CONTRAST
424
-    #define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT
416
+  #ifndef LCD_CONTRAST_DEFAULT
417
+    #define LCD_CONTRAST_DEFAULT LCD_CONTRAST_INIT
425 418
   #endif
426 419
 #endif
427 420
 

+ 4
- 0
Marlin/src/inc/Warnings.cpp Näytä tiedosto

@@ -559,3 +559,7 @@
559 559
 #if CANNOT_EMBED_CONFIGURATION
560 560
   #warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
561 561
 #endif
562
+
563
+#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX
564
+  #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX."
565
+#endif

+ 3
- 0
Marlin/src/lcd/e3v2/creality/dwin.cpp Näytä tiedosto

@@ -1834,6 +1834,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT)
1834 1834
 
1835 1835
 void HMI_SDCardInit() { card.cdroot(); }
1836 1836
 
1837
+// Initialize or re-initialize the LCD
1838
+void MarlinUI::init_lcd() { DWIN_Startup(); }
1839
+
1837 1840
 void MarlinUI::refresh() { /* Nothing to see here */ }
1838 1841
 
1839 1842
 #if HAS_LCD_BRIGHTNESS

+ 3
- 0
Marlin/src/lcd/e3v2/enhanced/dwin.cpp Näytä tiedosto

@@ -888,6 +888,9 @@ void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT)
888 888
 
889 889
 void HMI_SDCardInit() { card.cdroot(); }
890 890
 
891
+// Initialize or re-initialize the LCD
892
+void MarlinUI::init_lcd() { DWIN_Startup(); }
893
+
891 894
 void MarlinUI::refresh() { /* Nothing to see here */ }
892 895
 
893 896
 #if HAS_LCD_BRIGHTNESS

+ 1
- 1
Marlin/src/lcd/e3v2/jyersui/dwin.cpp Näytä tiedosto

@@ -4980,7 +4980,7 @@ void CrealityDWINClass::Reset_Settings() {
4980 4980
   Redraw_Screen();
4981 4981
 }
4982 4982
 
4983
-void MarlinUI::init() {
4983
+void MarlinUI::init_lcd() {
4984 4984
   delay(800);
4985 4985
   SERIAL_ECHOPGM("\nDWIN handshake ");
4986 4986
   if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error.");

+ 1
- 3
Marlin/src/lcd/e3v2/marlinui/ui_common.cpp Näytä tiedosto

@@ -79,9 +79,7 @@ void MarlinUI::set_font(const uint8_t font_nr) {
79 79
 bool MarlinUI::detected() { return true; }
80 80
 
81 81
 // Initialize or re-initialize the LCD
82
-void MarlinUI::init_lcd() {
83
-  DWIN_Startup();
84
-}
82
+void MarlinUI::init_lcd() { DWIN_Startup(); }
85 83
 
86 84
 // This LCD should clear where it will draw anew
87 85
 void MarlinUI::clear_lcd() {

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp Näytä tiedosto

@@ -1144,7 +1144,7 @@ namespace ExtUI {
1144 1144
 
1145 1145
 // At the moment we hook into MarlinUI methods, but this could be cleaned up in the future
1146 1146
 
1147
-void MarlinUI::init() { ExtUI::onStartup(); }
1147
+void MarlinUI::init_lcd() { ExtUI::onStartup(); }
1148 1148
 
1149 1149
 void MarlinUI::update() { ExtUI::onIdle(); }
1150 1150
 

+ 72
- 77
Marlin/src/lcd/marlinui.cpp Näytä tiedosto

@@ -43,7 +43,6 @@ MarlinUI ui;
43 43
 #if HAS_DISPLAY
44 44
   #include "../gcode/queue.h"
45 45
   #include "fontutils.h"
46
-  #include "../sd/cardreader.h"
47 46
 #endif
48 47
 
49 48
 #if ENABLED(DWIN_CREALITY_LCD)
@@ -176,6 +175,77 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
176 175
 
177 176
 #endif
178 177
 
178
+// Encoder Handling
179
+#if HAS_ENCODER_ACTION
180
+  uint32_t MarlinUI::encoderPosition;
181
+  volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update
182
+#endif
183
+
184
+void MarlinUI::init() {
185
+
186
+  init_lcd();
187
+
188
+  #if HAS_DIGITAL_BUTTONS
189
+    #if BUTTON_EXISTS(EN1)
190
+      SET_INPUT_PULLUP(BTN_EN1);
191
+    #endif
192
+    #if BUTTON_EXISTS(EN2)
193
+      SET_INPUT_PULLUP(BTN_EN2);
194
+    #endif
195
+    #if BUTTON_EXISTS(ENC)
196
+      SET_INPUT_PULLUP(BTN_ENC);
197
+    #endif
198
+    #if BUTTON_EXISTS(ENC_EN)
199
+      SET_INPUT_PULLUP(BTN_ENC_EN);
200
+    #endif
201
+    #if BUTTON_EXISTS(BACK)
202
+      SET_INPUT_PULLUP(BTN_BACK);
203
+    #endif
204
+    #if BUTTON_EXISTS(UP)
205
+      SET_INPUT(BTN_UP);
206
+    #endif
207
+    #if BUTTON_EXISTS(DWN)
208
+      SET_INPUT(BTN_DWN);
209
+    #endif
210
+    #if BUTTON_EXISTS(LFT)
211
+      SET_INPUT(BTN_LFT);
212
+    #endif
213
+    #if BUTTON_EXISTS(RT)
214
+      SET_INPUT(BTN_RT);
215
+    #endif
216
+  #endif
217
+
218
+  #if HAS_SHIFT_ENCODER
219
+
220
+    #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
221
+
222
+      SET_OUTPUT(SR_DATA_PIN);
223
+      SET_OUTPUT(SR_CLK_PIN);
224
+
225
+    #elif PIN_EXISTS(SHIFT_CLK)
226
+
227
+      SET_OUTPUT(SHIFT_CLK_PIN);
228
+      OUT_WRITE(SHIFT_LD_PIN, HIGH);
229
+      #if PIN_EXISTS(SHIFT_EN)
230
+        OUT_WRITE(SHIFT_EN_PIN, LOW);
231
+      #endif
232
+      SET_INPUT_PULLUP(SHIFT_OUT_PIN);
233
+
234
+    #endif
235
+
236
+  #endif // HAS_SHIFT_ENCODER
237
+
238
+  #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS)
239
+    slow_buttons = 0;
240
+  #endif
241
+
242
+  update_buttons();
243
+
244
+  TERN_(HAS_ENCODER_ACTION, encoderDiff = 0);
245
+
246
+  reset_status(); // Set welcome message
247
+}
248
+
179 249
 #if HAS_WIRED_LCD
180 250
 
181 251
   #if HAS_MARLINUI_U8GLIB
@@ -184,8 +254,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
184 254
 
185 255
   #include "lcdprint.h"
186 256
 
187
-  #include "../sd/cardreader.h"
188
-
189 257
   #include "../module/temperature.h"
190 258
   #include "../module/planner.h"
191 259
   #include "../module/motion.h"
@@ -247,16 +315,8 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
247 315
     bool MarlinUI::old_is_printing;
248 316
   #endif
249 317
 
250
-  // Encoder Handling
251
-  #if HAS_ENCODER_ACTION
252
-    uint32_t MarlinUI::encoderPosition;
253
-    volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update
254
-  #endif
255
-
256 318
   #if ENABLED(SDSUPPORT)
257 319
 
258
-    #include "../sd/cardreader.h"
259
-
260 320
     #if MARLINUI_SCROLL_NAME
261 321
       uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max;
262 322
     #endif
@@ -393,69 +453,6 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
393 453
 
394 454
   #endif // HAS_LCD_MENU
395 455
 
396
-  void MarlinUI::init() {
397
-
398
-    init_lcd();
399
-
400
-    #if HAS_DIGITAL_BUTTONS
401
-      #if BUTTON_EXISTS(EN1)
402
-        SET_INPUT_PULLUP(BTN_EN1);
403
-      #endif
404
-      #if BUTTON_EXISTS(EN2)
405
-        SET_INPUT_PULLUP(BTN_EN2);
406
-      #endif
407
-      #if BUTTON_EXISTS(ENC)
408
-        SET_INPUT_PULLUP(BTN_ENC);
409
-      #endif
410
-      #if BUTTON_EXISTS(ENC_EN)
411
-        SET_INPUT_PULLUP(BTN_ENC_EN);
412
-      #endif
413
-      #if BUTTON_EXISTS(BACK)
414
-        SET_INPUT_PULLUP(BTN_BACK);
415
-      #endif
416
-      #if BUTTON_EXISTS(UP)
417
-        SET_INPUT(BTN_UP);
418
-      #endif
419
-      #if BUTTON_EXISTS(DWN)
420
-        SET_INPUT(BTN_DWN);
421
-      #endif
422
-      #if BUTTON_EXISTS(LFT)
423
-        SET_INPUT(BTN_LFT);
424
-      #endif
425
-      #if BUTTON_EXISTS(RT)
426
-        SET_INPUT(BTN_RT);
427
-      #endif
428
-    #endif
429
-
430
-    #if HAS_SHIFT_ENCODER
431
-
432
-      #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
433
-
434
-        SET_OUTPUT(SR_DATA_PIN);
435
-        SET_OUTPUT(SR_CLK_PIN);
436
-
437
-      #elif PIN_EXISTS(SHIFT_CLK)
438
-
439
-        SET_OUTPUT(SHIFT_CLK_PIN);
440
-        OUT_WRITE(SHIFT_LD_PIN, HIGH);
441
-        #if PIN_EXISTS(SHIFT_EN)
442
-          OUT_WRITE(SHIFT_EN_PIN, LOW);
443
-        #endif
444
-        SET_INPUT_PULLUP(SHIFT_OUT_PIN);
445
-
446
-      #endif
447
-
448
-    #endif // HAS_SHIFT_ENCODER
449
-
450
-    #if BOTH(HAS_ENCODER_ACTION, HAS_SLOW_BUTTONS)
451
-      slow_buttons = 0;
452
-    #endif
453
-
454
-    update_buttons();
455
-
456
-    TERN_(HAS_ENCODER_ACTION, encoderDiff = 0);
457
-  }
458
-
459 456
   ////////////////////////////////////////////
460 457
   ///////////// Keypad Handling //////////////
461 458
   ////////////////////////////////////////////
@@ -629,9 +626,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
629 626
           next_filament_display = millis() + 5000UL;  // Show status message for 5s
630 627
         #endif
631 628
         goto_screen(menu_main);
632
-        #if DISABLED(NO_LCD_REINIT)
633
-          init_lcd(); // May revive the LCD if static electricity killed it
634
-        #endif
629
+        IF_DISABLED(NO_LCD_REINIT, init_lcd()); // May revive the LCD if static electricity killed it
635 630
         return;
636 631
       }
637 632
 

+ 15
- 14
Marlin/src/lcd/marlinui.h Näytä tiedosto

@@ -21,6 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "../sd/cardreader.h"
24 25
 #include "../module/motion.h"
25 26
 #include "buttons.h"
26 27
 
@@ -30,10 +31,6 @@
30 31
   #include "../libs/buzzer.h"
31 32
 #endif
32 33
 
33
-#if ENABLED(SDSUPPORT)
34
-  #include "../sd/cardreader.h"
35
-#endif
36
-
37 34
 #if ENABLED(TOUCH_SCREEN_CALIBRATION)
38 35
   #include "tft_io/touch_calibration.h"
39 36
 #endif
@@ -204,6 +201,20 @@ public:
204 201
     TERN_(HAS_LCD_MENU, currentScreen = status_screen);
205 202
   }
206 203
 
204
+  static void init();
205
+
206
+  #if HAS_DISPLAY || HAS_DWIN_E3V2
207
+    static void init_lcd();
208
+  #else
209
+    static void init_lcd() {}
210
+  #endif
211
+
212
+  #if HAS_WIRED_LCD
213
+    static bool detected();
214
+  #else
215
+    static bool detected() { return true; }
216
+  #endif
217
+
207 218
   #if HAS_MULTI_LANGUAGE
208 219
     static uint8_t language;
209 220
     static void set_language(const uint8_t lang);
@@ -270,14 +281,6 @@ public:
270 281
     }
271 282
   #endif
272 283
 
273
-  #if HAS_WIRED_LCD
274
-    static bool detected();
275
-    static void init_lcd();
276
-  #else
277
-    static bool detected() { return true; }
278
-    static void init_lcd() {}
279
-  #endif
280
-
281 284
   #if HAS_PRINT_PROGRESS
282 285
     #if HAS_PRINT_PROGRESS_PERMYRIAD
283 286
       typedef uint16_t progress_t;
@@ -365,7 +368,6 @@ public:
365 368
 
366 369
   #if HAS_DISPLAY
367 370
 
368
-    static void init();
369 371
     static void update();
370 372
 
371 373
     static void abort_print();
@@ -480,7 +482,6 @@ public:
480 482
 
481 483
   #else // No LCD
482 484
 
483
-    static void init() {}
484 485
     static void update() {}
485 486
     static void return_to_status() {}
486 487
 

+ 1
- 1
Marlin/src/lcd/menu/menu_configuration.cpp Näytä tiedosto

@@ -538,7 +538,7 @@ void menu_configuration() {
538 538
   #if HAS_LCD_BRIGHTNESS
539 539
     EDIT_ITEM_FAST(uint8, MSG_BRIGHTNESS, &ui.brightness, LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.refresh_brightness, true);
540 540
   #endif
541
-  #if HAS_LCD_CONTRAST
541
+  #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX
542 542
     EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true);
543 543
   #endif
544 544
   #if ENABLED(FWRETRACT)

+ 17
- 27
Marlin/src/module/settings.cpp Näytä tiedosto

@@ -1965,8 +1965,10 @@ void MarlinSettings::postprocess() {
1965 1965
       //
1966 1966
       #if HAS_USER_THERMISTORS
1967 1967
       {
1968
+        user_thermistor_t user_thermistor[USER_THERMISTORS];
1968 1969
         _FIELD_TEST(user_thermistor);
1969
-        EEPROM_READ(thermalManager.user_thermistor);
1970
+        EEPROM_READ(user_thermistor);
1971
+        if (!validating) COPY(thermalManager.user_thermistor, user_thermistor);
1970 1972
       }
1971 1973
       #endif
1972 1974
 
@@ -1974,13 +1976,10 @@ void MarlinSettings::postprocess() {
1974 1976
       // Power monitor
1975 1977
       //
1976 1978
       {
1977
-        #if HAS_POWER_MONITOR
1978
-          uint8_t &power_monitor_flags = power_monitor.flags;
1979
-        #else
1980
-          uint8_t power_monitor_flags;
1981
-        #endif
1979
+        uint8_t power_monitor_flags;
1982 1980
         _FIELD_TEST(power_monitor_flags);
1983 1981
         EEPROM_READ(power_monitor_flags);
1982
+        TERN_(HAS_POWER_MONITOR, if (!validating) power_monitor.flags = power_monitor_flags);
1984 1983
       }
1985 1984
 
1986 1985
       //
@@ -1997,7 +1996,6 @@ void MarlinSettings::postprocess() {
1997 1996
       // LCD Brightness
1998 1997
       //
1999 1998
       {
2000
-        _FIELD_TEST(lcd_brightness);
2001 1999
         uint8_t lcd_brightness;
2002 2000
         EEPROM_READ(lcd_brightness);
2003 2001
         TERN_(HAS_LCD_BRIGHTNESS, if (!validating) ui.set_brightness(lcd_brightness));
@@ -2007,45 +2005,37 @@ void MarlinSettings::postprocess() {
2007 2005
       // Controller Fan
2008 2006
       //
2009 2007
       {
2008
+        controllerFan_settings_t cfs = { 0 };
2010 2009
         _FIELD_TEST(controllerFan_settings);
2011
-        #if ENABLED(CONTROLLER_FAN_EDITABLE)
2012
-          const controllerFan_settings_t &cfs = controllerFan.settings;
2013
-        #else
2014
-          controllerFan_settings_t cfs = { 0 };
2015
-        #endif
2016 2010
         EEPROM_READ(cfs);
2011
+        TERN_(CONTROLLER_FAN_EDITABLE, if (!validating) controllerFan.settings = cfs);
2017 2012
       }
2018 2013
 
2019 2014
       //
2020 2015
       // Power-Loss Recovery
2021 2016
       //
2022 2017
       {
2018
+        bool recovery_enabled;
2023 2019
         _FIELD_TEST(recovery_enabled);
2024
-        #if ENABLED(POWER_LOSS_RECOVERY)
2025
-          const bool &recovery_enabled = recovery.enabled;
2026
-        #else
2027
-          bool recovery_enabled;
2028
-        #endif
2029 2020
         EEPROM_READ(recovery_enabled);
2021
+        TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.enabled = recovery_enabled);
2030 2022
       }
2031 2023
 
2032 2024
       //
2033 2025
       // Firmware Retraction
2034 2026
       //
2035 2027
       {
2028
+        fwretract_settings_t fwretract_settings;
2029
+        bool autoretract_enabled;
2036 2030
         _FIELD_TEST(fwretract_settings);
2031
+        EEPROM_READ(fwretract_settings);
2032
+        EEPROM_READ(autoretract_enabled);
2037 2033
 
2038 2034
         #if ENABLED(FWRETRACT)
2039
-          EEPROM_READ(fwretract.settings);
2040
-        #else
2041
-          fwretract_settings_t fwretract_settings;
2042
-          EEPROM_READ(fwretract_settings);
2043
-        #endif
2044
-        #if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
2045
-          EEPROM_READ(fwretract.autoretract_enabled);
2046
-        #else
2047
-          bool autoretract_enabled;
2048
-          EEPROM_READ(autoretract_enabled);
2035
+          if (!validating) {
2036
+            fwretract.settings = fwretract_settings;
2037
+            TERN_(FWRETRACT_AUTORETRACT, fwretract.autoretract_enabled = autoretract_enabled);
2038
+          }
2049 2039
         #endif
2050 2040
       }
2051 2041
 

+ 1
- 1
Marlin/src/pins/mega/pins_GT2560_REV_A.h Näytä tiedosto

@@ -127,7 +127,7 @@
127 127
 
128 128
       #define LCD_RESET_PIN                   16
129 129
 
130
-      #define DEFAULT_LCD_CONTRAST           220
130
+      #define LCD_CONTRAST_DEFAULT           220
131 131
 
132 132
       #define LCD_BACKLIGHT_PIN               -1
133 133
     #else

+ 1
- 1
Marlin/src/pins/mega/pins_HJC2560C_REV2.h Näytä tiedosto

@@ -134,7 +134,7 @@
134 134
     #if ENABLED(HJC_LCD_SMART_CONTROLLER)
135 135
       #define LCD_BACKLIGHT_PIN                5  // LCD_Backlight
136 136
       //#ifndef LCD_CONTRAST_PIN
137
-      //  #define LCD_CONTRAST_PIN  5   // LCD_Contrast
137
+      //  #define LCD_CONTRAST_PIN             5  // LCD_Contrast
138 138
       //#endif
139 139
       #ifndef FIL_RUNOUT_PIN
140 140
         #define FIL_RUNOUT_PIN                24  // Filament runout

+ 1
- 1
Marlin/src/pins/ramps/pins_K8800.h Näytä tiedosto

@@ -107,7 +107,7 @@
107 107
 
108 108
   #define LCD_CONTRAST_MIN                     0
109 109
   #define LCD_CONTRAST_MAX                   100
110
-  #define DEFAULT_LCD_CONTRAST                30
110
+  #define LCD_CONTRAST_DEFAULT                30
111 111
   //#define LCD_SCREEN_ROTATE                180  // 0, 90, 180, 270
112 112
 
113 113
   #if IS_NEWPANEL

+ 1
- 1
Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h Näytä tiedosto

@@ -157,7 +157,7 @@
157 157
       #define NEOPIXEL_PIN                  PB9
158 158
     #endif
159 159
 
160
-    #define DEFAULT_LCD_CONTRAST             255
160
+    #define LCD_CONTRAST_DEFAULT             255
161 161
   #else
162 162
     #define LCD_PINS_RS                     PC15
163 163
     #define LCD_PINS_ENABLE                 PB6

Loading…
Peruuta
Tallenna