Browse Source

Improved EEPROM boot error (#17916)

Scott Lahteine 4 years ago
parent
commit
52aa459a2d
No account linked to committer's email address

+ 4
- 3
Marlin/src/lcd/language/language_en.h View File

@@ -328,9 +328,9 @@ namespace Language_en {
328 328
   PROGMEM Language_Str MSG_LOAD_EEPROM                     = _UxGT("Load Settings");
329 329
   PROGMEM Language_Str MSG_RESTORE_DEFAULTS                = _UxGT("Restore Defaults");
330 330
   PROGMEM Language_Str MSG_INIT_EEPROM                     = _UxGT("Initialize EEPROM");
331
-  PROGMEM Language_Str MSG_ERR_EEPROM_CRC                  = _UxGT("Err: EEPROM CRC");
332
-  PROGMEM Language_Str MSG_ERR_EEPROM_INDEX                = _UxGT("Err: EEPROM Index");
333
-  PROGMEM Language_Str MSG_ERR_EEPROM_VERSION              = _UxGT("Err: EEPROM Version");
331
+  PROGMEM Language_Str MSG_ERR_EEPROM_CRC                  = _UxGT("EEPROM CRC Error");
332
+  PROGMEM Language_Str MSG_ERR_EEPROM_INDEX                = _UxGT("EEPROM Index Error");
333
+  PROGMEM Language_Str MSG_ERR_EEPROM_VERSION              = _UxGT("EEPROM Version Error");
334 334
   PROGMEM Language_Str MSG_SETTINGS_STORED                 = _UxGT("Settings Stored");
335 335
   PROGMEM Language_Str MSG_MEDIA_UPDATE                    = _UxGT("Media Update");
336 336
   PROGMEM Language_Str MSG_RESET_PRINTER                   = _UxGT("Reset Printer");
@@ -344,6 +344,7 @@ namespace Language_en {
344 344
   PROGMEM Language_Str MSG_BUTTON_STOP                     = _UxGT("Stop");
345 345
   PROGMEM Language_Str MSG_BUTTON_PRINT                    = _UxGT("Print");
346 346
   PROGMEM Language_Str MSG_BUTTON_RESET                    = _UxGT("Reset");
347
+  PROGMEM Language_Str MSG_BUTTON_IGNORE                   = _UxGT("Ignore");
347 348
   PROGMEM Language_Str MSG_BUTTON_CANCEL                   = _UxGT("Cancel");
348 349
   PROGMEM Language_Str MSG_BUTTON_DONE                     = _UxGT("Done");
349 350
   PROGMEM Language_Str MSG_BUTTON_BACK                     = _UxGT("Back");

+ 4
- 12
Marlin/src/lcd/menu/menu.cpp View File

@@ -34,10 +34,6 @@
34 34
   #include "../../libs/buzzer.h"
35 35
 #endif
36 36
 
37
-#if ENABLED(EEPROM_SETTINGS)
38
-  #include "../../module/configuration_store.h"
39
-#endif
40
-
41 37
 #if WATCH_HOTENDS || WATCH_BED
42 38
   #include "../../module/temperature.h"
43 39
 #endif
@@ -228,7 +224,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
228 224
         if (on_status_screen())
229 225
           doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
230 226
       }
231
-      else if (screen == status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) {
227
+      else if (on_status_screen() && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) {
232 228
         if ( (ENABLED(BABYSTEP_WITHOUT_HOMING) || all_axes_known())
233 229
           && (ENABLED(BABYSTEP_ALWAYS_AVAILABLE) || printer_busy()) )
234 230
           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
245 241
     encoderPosition = encoder;
246 242
     encoderTopLine = top;
247 243
     screen_items = items;
248
-    if (screen == status_screen) {
244
+    if (on_status_screen()) {
249 245
       defer_status_screen(false);
250 246
       TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false);
251 247
       screen_history_depth = 0;
@@ -256,7 +252,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
256 252
     // Re-initialize custom characters that may be re-used
257 253
     #if HAS_CHARACTER_LCD
258 254
       if (TERN1(AUTO_BED_LEVELING_UBL, !ubl.lcd_map_control))
259
-        set_custom_characters(screen == status_screen ? CHARSET_INFO : CHARSET_MENU);
255
+        set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
260 256
     #endif
261 257
 
262 258
     refresh(LCDVIEW_CALL_REDRAW_NEXT);
@@ -383,11 +379,6 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
383 379
 
384 380
 #endif // BABYSTEP_ZPROBE_OFFSET
385 381
 
386
-#if ENABLED(EEPROM_SETTINGS)
387
-  void lcd_store_settings() { ui.completion_feedback(settings.save()); }
388
-  void lcd_load_settings()  { ui.completion_feedback(settings.load()); }
389
-#endif
390
-
391 382
 void _lcd_draw_homing() {
392 383
   constexpr uint8_t line = (LCD_HEIGHT - 1) / 2;
393 384
   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
416 407
   if (got_click || ui.should_draw()) {
417 408
     draw_select_screen(yes, no, ui_selection, pref, string, suff);
418 409
     if (got_click) { ui_selection ? yesFunc() : noFunc(); }
410
+    ui.defer_status_screen();
419 411
   }
420 412
 }
421 413
 

+ 0
- 5
Marlin/src/lcd/menu/menu.h View File

@@ -589,11 +589,6 @@ void _lcd_draw_homing();
589 589
   #endif
590 590
 #endif
591 591
 
592
-#if ENABLED(EEPROM_SETTINGS)
593
-  void lcd_store_settings();
594
-  void lcd_load_settings();
595
-#endif
596
-
597 592
 #if ENABLED(POWER_LOSS_RECOVERY)
598 593
   void menu_job_recovery();
599 594
 #endif

+ 3
- 12
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -47,7 +47,7 @@
47 47
   #include "../../feature/runout.h"
48 48
 #endif
49 49
 
50
-#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
50
+#if ENABLED(SD_FIRMWARE_UPDATE)
51 51
   #include "../../module/configuration_store.h"
52 52
 #endif
53 53
 
@@ -97,10 +97,6 @@ void menu_cancelobject();
97 97
 
98 98
 #endif
99 99
 
100
-#if ENABLED(SD_FIRMWARE_UPDATE)
101
-  #include "../../module/configuration_store.h"
102
-#endif
103
-
104 100
 #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
105 101
   //
106 102
   // Advanced Settings > Filament
@@ -591,13 +587,8 @@ void menu_advanced_settings() {
591 587
   #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
592 588
     CONFIRM_ITEM(MSG_INIT_EEPROM,
593 589
       MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
594
-      []{
595
-        const bool inited = settings.init_eeprom();
596
-        ui.completion_feedback(inited);
597
-        UNUSED(inited);
598
-      },
599
-      ui.goto_previous_screen,
600
-      GET_TEXT(MSG_INIT_EEPROM), (PGM_P)nullptr, PSTR("?")
590
+      ui.init_eeprom, ui.goto_previous_screen,
591
+      GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?")
601 592
     );
602 593
   #endif
603 594
 

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_corners.cpp View File

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

+ 2
- 2
Marlin/src/lcd/menu/menu_bed_leveling.cpp View File

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

+ 5
- 8
Marlin/src/lcd/menu/menu_configuration.cpp View File

@@ -30,8 +30,6 @@
30 30
 
31 31
 #include "menu.h"
32 32
 
33
-#include "../../module/configuration_store.h"
34
-
35 33
 #if HAS_FILAMENT_SENSOR
36 34
   #include "../../feature/runout.h"
37 35
 #endif
@@ -174,7 +172,7 @@ void menu_advanced_settings();
174 172
     EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Y, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets);
175 173
     EDIT_ITEM_FAST(float42_52, MSG_HOTEND_OFFSET_Z, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets);
176 174
     #if ENABLED(EEPROM_SETTINGS)
177
-      ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
175
+      ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
178 176
     #endif
179 177
     END_MENU();
180 178
   }
@@ -335,7 +333,7 @@ void menu_advanced_settings();
335 333
       EDIT_ITEM(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAX_TARGET);
336 334
     #endif
337 335
     #if ENABLED(EEPROM_SETTINGS)
338
-      ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
336
+      ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
339 337
     #endif
340 338
     END_MENU();
341 339
   }
@@ -439,12 +437,11 @@ void menu_configuration() {
439 437
   #endif
440 438
 
441 439
   #if ENABLED(EEPROM_SETTINGS)
442
-    ACTION_ITEM(MSG_STORE_EEPROM, lcd_store_settings);
443
-    if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, lcd_load_settings);
440
+    ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
441
+    if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
444 442
   #endif
445 443
 
446
-  if (!busy)
447
-    ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); ui.completion_feedback(); });
444
+  if (!busy) ACTION_ITEM(MSG_RESTORE_DEFAULTS, ui.reset_settings);
448 445
 
449 446
   END_MENU();
450 447
 }

+ 2
- 2
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

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

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp View File

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

+ 1
- 1
Marlin/src/lcd/menu/menu_mixer.cpp View File

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

+ 66
- 41
Marlin/src/lcd/ultralcd.cpp View File

@@ -95,6 +95,7 @@ MarlinUI ui;
95 95
 #include "lcdprint.h"
96 96
 
97 97
 #include "../sd/cardreader.h"
98
+#include "../module/configuration_store.h"
98 99
 #include "../module/temperature.h"
99 100
 #include "../module/planner.h"
100 101
 #include "../module/motion.h"
@@ -879,11 +880,7 @@ void MarlinUI::update() {
879 880
     // This runs every ~100ms when idling often enough.
880 881
     // Instead of tracking changes just redraw the Status Screen once per second.
881 882
     if (on_status_screen() && !lcd_status_update_delay--) {
882
-      lcd_status_update_delay = 9
883
-        #if HAS_GRAPHICAL_LCD
884
-          + 3
885
-        #endif
886
-      ;
883
+      lcd_status_update_delay = TERN(HAS_GRAPHICAL_LCD, 12, 9);
887 884
       max_display_update_time--;
888 885
       refresh(LCDVIEW_REDRAW_NOW);
889 886
     }
@@ -1167,11 +1164,7 @@ void MarlinUI::update() {
1167 1164
           WRITE(SHIFT_CLK, HIGH);
1168 1165
           WRITE(SHIFT_CLK, LOW);
1169 1166
         }
1170
-        #if ENABLED(REPRAPWORLD_KEYPAD)
1171
-          keypad_buttons = ~val;
1172
-        #else
1173
-          buttons = ~val;
1174
-        #endif
1167
+        TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val;
1175 1168
       #endif
1176 1169
 
1177 1170
     } // next_button_update_ms
@@ -1238,7 +1231,7 @@ void MarlinUI::update() {
1238 1231
 
1239 1232
   void MarlinUI::finish_status(const bool persist) {
1240 1233
 
1241
-    #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
1234
+    #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE) > 0)
1242 1235
       UNUSED(persist);
1243 1236
     #endif
1244 1237
 
@@ -1438,18 +1431,10 @@ void MarlinUI::update() {
1438 1431
   #if HAS_PRINT_PROGRESS
1439 1432
 
1440 1433
     MarlinUI::progress_t MarlinUI::_get_progress() {
1441
-      #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
1442
-        const progress_t p = progress_override & PROGRESS_MASK;
1443
-      #else
1444
-        constexpr progress_t p = 0;
1445
-      #endif
1446
-      return (p
1434
+      return (
1435
+        TERN0(LCD_SET_PROGRESS_MANUALLY, (progress_override & PROGRESS_MASK))
1447 1436
         #if ENABLED(SDSUPPORT)
1448
-          #if HAS_PRINT_PROGRESS_PERMYRIAD
1449
-            ?: card.permyriadDone()
1450
-          #else
1451
-            ?: card.percentDone()
1452
-          #endif
1437
+          ?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone())
1453 1438
         #endif
1454 1439
       );
1455 1440
     }
@@ -1461,29 +1446,14 @@ void MarlinUI::update() {
1461 1446
   //
1462 1447
   // Send the status line as a host notification
1463 1448
   //
1464
-
1465 1449
   void MarlinUI::set_status(const char * const message, const bool) {
1466
-    #if ENABLED(HOST_PROMPT_SUPPORT)
1467
-      host_action_notify(message);
1468
-    #else
1469
-      UNUSED(message);
1470
-    #endif
1450
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(message), UNUSED(message));
1471 1451
   }
1472
-
1473 1452
   void MarlinUI::set_status_P(PGM_P message, const int8_t) {
1474
-    #if ENABLED(HOST_PROMPT_SUPPORT)
1475
-      host_action_notify(message);
1476
-    #else
1477
-      UNUSED(message);
1478
-    #endif
1453
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(message), UNUSED(message));
1479 1454
   }
1480
-
1481 1455
   void MarlinUI::status_printf_P(const uint8_t, PGM_P const message, ...) {
1482
-    #if ENABLED(HOST_PROMPT_SUPPORT)
1483
-      host_action_notify(message);
1484
-    #else
1485
-      UNUSED(message);
1486
-    #endif
1456
+    TERN(HOST_PROMPT_SUPPORT, host_action_notify(message), UNUSED(message));
1487 1457
   }
1488 1458
 
1489 1459
 #endif // !HAS_DISPLAY
@@ -1507,7 +1477,9 @@ void MarlinUI::update() {
1507 1477
         TERN_(EXTENSIBLE_UI, ExtUI::onMediaRemoved()); // ExtUI response
1508 1478
         #if PIN_EXISTS(SD_DETECT)
1509 1479
           set_status_P(GET_TEXT(MSG_MEDIA_REMOVED));
1510
-          TERN_(HAS_LCD_MENU, return_to_status());
1480
+          #if HAS_LCD_MENU
1481
+            if (!defer_return_to_status) return_to_status();
1482
+          #endif
1511 1483
         #endif
1512 1484
       }
1513 1485
     }
@@ -1530,3 +1502,56 @@ void MarlinUI::update() {
1530 1502
   }
1531 1503
 
1532 1504
 #endif // SDSUPPORT
1505
+
1506
+#if HAS_LCD_MENU
1507
+  void MarlinUI::reset_settings() { settings.reset(); completion_feedback(); }
1508
+#endif
1509
+
1510
+#if ENABLED(EEPROM_SETTINGS)
1511
+
1512
+  #if HAS_LCD_MENU
1513
+    void MarlinUI::init_eeprom() {
1514
+      const bool good = settings.init_eeprom();
1515
+      completion_feedback(good);
1516
+      return_to_status();
1517
+    }
1518
+    void MarlinUI::load_settings() {
1519
+      const bool good = settings.load();
1520
+      completion_feedback(good);
1521
+    }
1522
+    void MarlinUI::store_settings() {
1523
+      const bool good = settings.save();
1524
+      completion_feedback(good);
1525
+    }
1526
+  #endif
1527
+
1528
+  #if DISABLED(EEPROM_AUTO_INIT)
1529
+
1530
+    static inline PGM_P eeprom_err(const uint8_t msgid) {
1531
+      switch (msgid) {
1532
+        default:
1533
+        case 0: return GET_TEXT(MSG_ERR_EEPROM_CRC);
1534
+        case 1: return GET_TEXT(MSG_ERR_EEPROM_INDEX);
1535
+        case 2: return GET_TEXT(MSG_ERR_EEPROM_VERSION);
1536
+      }
1537
+    }
1538
+
1539
+    void MarlinUI::eeprom_alert(const uint8_t msgid) {
1540
+      #if HAS_LCD_MENU
1541
+        editable.uint8 = msgid;
1542
+        goto_screen([]{
1543
+          PGM_P const restore_msg = GET_TEXT(MSG_RESTORE_DEFAULTS);
1544
+          char msg[utf8_strlen_P(restore_msg) + 1];
1545
+          strcpy_P(msg, restore_msg);
1546
+          MenuItem_confirm::select_screen(
1547
+            GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_IGNORE),
1548
+            init_eeprom, return_to_status,
1549
+            eeprom_err(editable.uint8), msg, PSTR("?")
1550
+          );
1551
+        });
1552
+      #else
1553
+        set_status_P(eeprom_err(msgid));
1554
+      #endif
1555
+    }
1556
+  #endif
1557
+#endif

+ 32
- 8
Marlin/src/lcd/ultralcd.h View File

@@ -544,14 +544,40 @@ public:
544 544
 
545 545
   #endif
546 546
 
547
-  #define LCD_HAS_WAIT_FOR_MOVE EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
547
+  //
548
+  // EEPROM: Reset / Init / Load / Store
549
+  //
550
+  #if HAS_LCD_MENU
551
+    static void reset_settings();
552
+  #endif
553
+
554
+  #if ENABLED(EEPROM_SETTINGS)
555
+    #if HAS_LCD_MENU
556
+      static void init_eeprom();
557
+      static void load_settings();
558
+      static void store_settings();
559
+    #endif
560
+    #if DISABLED(EEPROM_AUTO_INIT)
561
+      static void eeprom_alert(const uint8_t msgid);
562
+      static inline void eeprom_alert_crc()     { eeprom_alert(0); }
563
+      static inline void eeprom_alert_index()   { eeprom_alert(1); }
564
+      static inline void eeprom_alert_version() { eeprom_alert(2); }
565
+    #endif
566
+  #endif
548 567
 
549
-  #if LCD_HAS_WAIT_FOR_MOVE
568
+  //
569
+  // Special handling if a move is underway
570
+  //
571
+  #if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING))
572
+    #define LCD_HAS_WAIT_FOR_MOVE 1
550 573
     static bool wait_for_move;
551 574
   #else
552 575
     static constexpr bool wait_for_move = false;
553 576
   #endif
554 577
 
578
+  //
579
+  // Block interaction while under external control
580
+  //
555 581
   #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION)
556 582
     static bool external_control;
557 583
     FORCE_INLINE static void capture() { external_control = true; }
@@ -615,12 +641,10 @@ private:
615 641
   #endif
616 642
 
617 643
   #if HAS_SPI_LCD
618
-    #if HAS_LCD_MENU
619
-      #if LCD_TIMEOUT_TO_STATUS > 0
620
-        static bool defer_return_to_status;
621
-      #else
622
-        static constexpr bool defer_return_to_status = false;
623
-      #endif
644
+    #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS > 0
645
+      static bool defer_return_to_status;
646
+    #else
647
+      static constexpr bool defer_return_to_status = false;
624 648
     #endif
625 649
     static void draw_status_screen();
626 650
   #endif

+ 4
- 10
Marlin/src/module/configuration_store.cpp View File

@@ -37,7 +37,7 @@
37 37
  */
38 38
 
39 39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V78"
40
+#define EEPROM_VERSION "V79"
41 41
 #define EEPROM_OFFSET 100
42 42
 
43 43
 // Check the integrity of data offsets.
@@ -1367,9 +1367,7 @@ void MarlinSettings::postprocess() {
1367 1367
       }
1368 1368
       DEBUG_ECHO_START();
1369 1369
       DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1370
-      #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
1371
-        LCD_MESSAGEPGM(MSG_ERR_EEPROM_VERSION);
1372
-      #endif
1370
+      TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_version());
1373 1371
       eeprom_error = true;
1374 1372
     }
1375 1373
     else {
@@ -2141,17 +2139,13 @@ void MarlinSettings::postprocess() {
2141 2139
       if (eeprom_error) {
2142 2140
         DEBUG_ECHO_START();
2143 2141
         DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
2144
-        #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
2145
-          LCD_MESSAGEPGM(MSG_ERR_EEPROM_INDEX);
2146
-        #endif
2142
+        TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_index());
2147 2143
       }
2148 2144
       else if (working_crc != stored_crc) {
2149 2145
         eeprom_error = true;
2150 2146
         DEBUG_ERROR_START();
2151 2147
         DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2152
-        #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
2153
-          LCD_MESSAGEPGM(MSG_ERR_EEPROM_CRC);
2154
-        #endif
2148
+        TERN(EEPROM_AUTO_INIT,,ui.eeprom_alert_crc());
2155 2149
       }
2156 2150
       else if (!validating) {
2157 2151
         DEBUG_ECHO_START();

Loading…
Cancel
Save