Browse Source

Merge pull request #3303 from thinkyhead/rc_various_fixes

Various patches for LCD menu issues
Scott Lahteine 8 years ago
parent
commit
e8f8a46ef5

+ 3
- 3
Marlin/Default_Version.h View File

@@ -28,9 +28,9 @@
28 28
 // #error "You must specify the following parameters related to your distribution"
29 29
 
30 30
 #if true
31
-#define SHORT_BUILD_VERSION "1.1.0-RC4"
32
-#define DETAILED_BUILD_VERSION "1.1.0-RC4 From Archive"
33
-#define STRING_DISTRIBUTION_DATE "2016-03-24 12:00"
31
+#define SHORT_BUILD_VERSION "1.1.0-RCBugFix"
32
+#define DETAILED_BUILD_VERSION "1.1.0-RCBugFix From Archive"
33
+#define STRING_DISTRIBUTION_DATE "2016-04-01 12:00"
34 34
 // It might also be appropriate to define a location where additional information can be found
35 35
 // #define SOURCE_CODE_URL  "http:// ..."
36 36
 #endif

+ 11
- 9
Marlin/dogm_lcd_implementation.h View File

@@ -378,7 +378,7 @@ static void lcd_implementation_status_screen() {
378 378
   u8g.setColorIndex(0); // white on black
379 379
   u8g.setPrintPos(2, XYZ_BASELINE);
380 380
   if (blink)
381
-    lcd_printPGM(PSTR("X"));
381
+    lcd_printPGM(PSTR(MSG_X));
382 382
   else {
383 383
     if (!axis_homed[X_AXIS])
384 384
       lcd_printPGM(PSTR("?"));
@@ -388,7 +388,7 @@ static void lcd_implementation_status_screen() {
388 388
           lcd_printPGM(PSTR(" "));
389 389
         else
390 390
       #endif
391
-      lcd_printPGM(PSTR("X"));
391
+      lcd_printPGM(PSTR(MSG_X));
392 392
     }
393 393
   }
394 394
   u8g.drawPixel(8, XYZ_BASELINE - 5);
@@ -398,7 +398,7 @@ static void lcd_implementation_status_screen() {
398 398
 
399 399
   u8g.setPrintPos(43, XYZ_BASELINE);
400 400
   if (blink)
401
-    lcd_printPGM(PSTR("Y"));
401
+    lcd_printPGM(PSTR(MSG_Y));
402 402
   else {
403 403
     if (!axis_homed[Y_AXIS])
404 404
       lcd_printPGM(PSTR("?"));
@@ -408,7 +408,7 @@ static void lcd_implementation_status_screen() {
408 408
           lcd_printPGM(PSTR(" "));
409 409
         else
410 410
       #endif
411
-      lcd_printPGM(PSTR("Y"));
411
+      lcd_printPGM(PSTR(MSG_Y));
412 412
     }
413 413
   }
414 414
   u8g.drawPixel(49, XYZ_BASELINE - 5);
@@ -418,7 +418,7 @@ static void lcd_implementation_status_screen() {
418 418
 
419 419
   u8g.setPrintPos(83, XYZ_BASELINE);
420 420
   if (blink)
421
-    lcd_printPGM(PSTR("Z"));
421
+    lcd_printPGM(PSTR(MSG_Z));
422 422
   else {
423 423
     if (!axis_homed[Z_AXIS])
424 424
       lcd_printPGM(PSTR("?"));
@@ -428,7 +428,7 @@ static void lcd_implementation_status_screen() {
428 428
           lcd_printPGM(PSTR(" "));
429 429
         else
430 430
       #endif
431
-      lcd_printPGM(PSTR("Z"));
431
+      lcd_printPGM(PSTR(MSG_Z));
432 432
     }
433 433
   }
434 434
   u8g.drawPixel(89, XYZ_BASELINE - 5);
@@ -562,9 +562,11 @@ void lcd_implementation_drawedit(const char* pstr, const char* value) {
562 562
 
563 563
   u8g.setPrintPos(0, rowHeight + kHalfChar);
564 564
   lcd_printPGM(pstr);
565
-  lcd_print(':');
566
-  u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
567
-  lcd_print(value);
565
+  if (value != NULL) {
566
+    lcd_print(':');
567
+    u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
568
+    lcd_print(value);
569
+  }
568 570
 }
569 571
 
570 572
 #if ENABLED(SDSUPPORT)

+ 1
- 1
Marlin/language_an.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       " Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Amortar motors"
44 44
 #define MSG_AUTO_HOME                       "Levar a l'orichen"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
47 47
 #define MSG_SET_ORIGIN                      "Establir zero"
48 48
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"

+ 1
- 1
Marlin/language_bg.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Автостарт"
43 43
 #define MSG_DISABLE_STEPPERS                "Изкл. двигатели"
44 44
 #define MSG_AUTO_HOME                       "Паркиране"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Задай Начало"
47 47
 #define MSG_SET_ORIGIN                      "Изходна точка"
48 48
 #define MSG_PREHEAT_PLA                     "Подгряване PLA"

+ 1
- 1
Marlin/language_ca.h View File

@@ -43,7 +43,7 @@
43 43
 #define MSG_AUTOSTART                       "Inici automatic"
44 44
 #define MSG_DISABLE_STEPPERS                "Apagar motors"
45 45
 #define MSG_AUTO_HOME                       "Home global"
46
-#define MSG_LEVEL_BED_HOMING                "Homing"
46
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47 47
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48 48
 #define MSG_SET_ORIGIN                      "Establir origen"
49 49
 #define MSG_PREHEAT_PLA                     "Preescalfar PLA"

+ 1
- 1
Marlin/language_cn.h View File

@@ -40,7 +40,7 @@
40 40
 #define MSG_AUTOSTART                       "\xb1\xb2\xb3\xb4"
41 41
 #define MSG_DISABLE_STEPPERS                "\xb5\xb6\xb7\xb8\xb9\xba"
42 42
 #define MSG_AUTO_HOME                       "\xbb\xbc\xbd"
43
-#define MSG_LEVEL_BED_HOMING                "Homing"
43
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
44 44
 #define MSG_SET_HOME_OFFSETS                "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
45 45
 #define MSG_SET_ORIGIN                      "\xbe\xbf\xbc\xbd"
46 46
 #define MSG_PREHEAT_PLA                     "\xc3\xc4 PLA"

+ 1
- 1
Marlin/language_da.h View File

@@ -43,7 +43,7 @@
43 43
 #define MSG_AUTO_HOME                       "Home" // G28
44 44
 #define MSG_COOLDOWN                        "Afkøl"
45 45
 #define MSG_DISABLE_STEPPERS                "Slå stepper fra"
46
-#define MSG_LEVEL_BED_HOMING                "Homing"
46
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47 47
 #define MSG_SET_HOME_OFFSETS                "Sæt home offsets"
48 48
 #define MSG_SET_ORIGIN                      "Sæt origin"
49 49
 #define MSG_SWITCH_PS_ON                    "Slå strøm til"

+ 1
- 1
Marlin/language_de.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Motoren Aus" // M84
44 44
 #define MSG_AUTO_HOME                       "Home" // G28
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Setze Home hier"
47 47
 #define MSG_SET_ORIGIN                      "Setze Null hier" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp
48 48
 #define MSG_PREHEAT_PLA                     "Vorwärmen PLA"

+ 1
- 1
Marlin/language_en.h View File

@@ -62,7 +62,7 @@
62 62
   #define MSG_AUTO_HOME                       "Auto home"
63 63
 #endif
64 64
 #ifndef MSG_LEVEL_BED_HOMING
65
-  #define MSG_LEVEL_BED_HOMING                "Homing"
65
+  #define MSG_LEVEL_BED_HOMING                "Homing XYZ"
66 66
 #endif
67 67
 #ifndef MSG_SET_HOME_OFFSETS
68 68
   #define MSG_SET_HOME_OFFSETS                "Set home offsets"

+ 1
- 1
Marlin/language_es.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Apagar motores"
44 44
 #define MSG_AUTO_HOME                       "Llevar al origen"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Ajustar offsets"
47 47
 #define MSG_SET_ORIGIN                      "Establecer cero"
48 48
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"

+ 1
- 1
Marlin/language_eu.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Auto hasiera"
43 43
 #define MSG_DISABLE_STEPPERS                "Itzali motoreak"
44 44
 #define MSG_AUTO_HOME                       "Hasierara joan"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
47 47
 #define MSG_SET_ORIGIN                      "Hasiera ipini"
48 48
 #define MSG_PREHEAT_PLA                     "Aurreberotu PLA"

+ 1
- 1
Marlin/language_fi.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Automaatti"
43 43
 #define MSG_DISABLE_STEPPERS                "Vapauta moottorit"
44 44
 #define MSG_AUTO_HOME                       "Aja referenssiin"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
47 47
 #define MSG_SET_ORIGIN                      "Aseta origo"
48 48
 #define MSG_PREHEAT_PLA                     "Esilämmitä PLA"

+ 1
- 1
Marlin/language_fr.h View File

@@ -43,7 +43,7 @@
43 43
 #define MSG_AUTOSTART                       "Demarrage auto"
44 44
 #define MSG_DISABLE_STEPPERS                "Arreter moteurs"
45 45
 #define MSG_AUTO_HOME                       "Home auto."
46
-#define MSG_LEVEL_BED_HOMING                "Homing"
46
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
47 47
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
48 48
 #define MSG_SET_ORIGIN                      "Regler origine"
49 49
 #define MSG_PREHEAT_PLA                     "Prechauffage PLA"

+ 1
- 1
Marlin/language_it.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Disabilita Motori"
44 44
 #define MSG_AUTO_HOME                       "Auto Home"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Setta offset home"
47 47
 #define MSG_SET_ORIGIN                      "Imposta Origine"
48 48
 #define MSG_PREHEAT_PLA                     "Preriscalda PLA"

+ 1
- 1
Marlin/language_kana.h View File

@@ -44,7 +44,7 @@
44 44
 #define MSG_AUTOSTART                       "\xbc\xde\xc4\xde\xb3\xb6\xb2\xbc"                             // "Autostart"
45 45
 #define MSG_DISABLE_STEPPERS                "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc"         // "Disable steppers"
46 46
 #define MSG_AUTO_HOME                       "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Auto home"
47
-#define MSG_LEVEL_BED_HOMING                "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Homing"
47
+#define MSG_LEVEL_BED_HOMING                "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Homing XYZ"
48 48
 #define MSG_SET_HOME_OFFSETS                "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2"     // "Set home offsets"
49 49
 #define MSG_SET_ORIGIN                      "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4"                             // "Set origin"
50 50
 #define MSG_PREHEAT_PLA                     "PLA \xd6\xc8\xc2"                                             // "Preheat PLA"

+ 1
- 1
Marlin/language_nl.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Motoren uit"
44 44
 #define MSG_AUTO_HOME                       "Auto home"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
47 47
 #define MSG_SET_ORIGIN                      "Nulpunt instellen"
48 48
 #define MSG_PREHEAT_PLA                     "PLA voorverwarmen"

+ 1
- 1
Marlin/language_pl.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Wylacz silniki"
44 44
 #define MSG_AUTO_HOME                       "Auto. poz. zerowa"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
47 47
 #define MSG_SET_ORIGIN                      "Ustaw punkt zero"
48 48
 #define MSG_PREHEAT_PLA                     "Rozgrzej PLA"

+ 1
- 1
Marlin/language_pt-br.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Autostart"
43 43
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
44 44
 #define MSG_AUTO_HOME                       "Ir para origen"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
47 47
 #define MSG_SET_ORIGIN                      "Ajustar orig."
48 48
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"

+ 1
- 1
Marlin/language_ru.h View File

@@ -42,7 +42,7 @@
42 42
 #define MSG_AUTOSTART                       "Автостарт"
43 43
 #define MSG_DISABLE_STEPPERS                "Выкл. двигатели"
44 44
 #define MSG_AUTO_HOME                       "Парковка"
45
-#define MSG_LEVEL_BED_HOMING                "Homing"
45
+#define MSG_LEVEL_BED_HOMING                "Homing XYZ"
46 46
 #define MSG_SET_HOME_OFFSETS                "Запомнить парковку"
47 47
 #define MSG_SET_ORIGIN                      "Запомнить ноль"
48 48
 #define MSG_PREHEAT_PLA                     "Преднагрев PLA"

+ 40
- 28
Marlin/ultralcd.cpp View File

@@ -267,7 +267,7 @@ static void lcd_status_screen();
267 267
   uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
268 268
   millis_t next_button_update_ms;
269 269
   uint8_t lastEncoderBits;
270
-  uint32_t encoderPosition;
270
+  uint32_t encoderPosition, prevEncoderPosition;
271 271
   #if PIN_EXISTS(SD_DETECT)
272 272
     uint8_t lcd_sd_status;
273 273
   #endif
@@ -279,16 +279,15 @@ millis_t next_lcd_update_ms;
279 279
 uint8_t lcd_status_update_delay;
280 280
 bool ignore_click = false;
281 281
 bool wait_for_unclick;
282
+bool defer_return_to_status = false;
282 283
 uint8_t lcdDrawUpdate = 2;                  /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
283 284
 
284
-//prevMenu and prevEncoderPosition are used to store the previous menu location when editing settings.
285
-menuFunc_t prevMenu = NULL;
286
-uint16_t prevEncoderPosition;
287
-//Variables used when editing values.
285
+// Variables used when editing values.
288 286
 const char* editLabel;
289 287
 void* editValue;
290 288
 int32_t minEditValue, maxEditValue;
291
-menuFunc_t callbackFunc;
289
+menuFunc_t prevMenu = NULL;           // return here after editing (also prevEncoderPosition)
290
+menuFunc_t callbackFunc;              // call this after editing
292 291
 
293 292
 // place-holders for Ki and Kd edits
294 293
 float raw_Ki, raw_Kd;
@@ -299,6 +298,7 @@ float raw_Ki, raw_Kd;
299 298
 static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) {
300 299
   if (currentMenu != menu) {
301 300
     currentMenu = menu;
301
+    lcdDrawUpdate = 2;
302 302
     #if ENABLED(NEWPANEL)
303 303
       encoderPosition = encoder;
304 304
       if (feedback) lcd_quick_feedback();
@@ -310,9 +310,20 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const ui
310 310
   }
311 311
 }
312 312
 
313
-inline void lcd_save_previous_menu() { prevMenu = currentMenu; prevEncoderPosition = encoderPosition; }
313
+inline void lcd_save_previous_menu() {
314
+  prevMenu = currentMenu;
315
+  #if ENABLED(ULTIPANEL)
316
+    prevEncoderPosition = encoderPosition;
317
+  #endif
318
+}
314 319
 
315
-static void lcd_goto_previous_menu() { lcd_goto_menu(prevMenu, true, prevEncoderPosition); }
320
+static void lcd_goto_previous_menu() {
321
+  lcd_goto_menu(prevMenu, true
322
+    #if ENABLED(ULTIPANEL)
323
+      , prevEncoderPosition
324
+    #endif
325
+  );
326
+}
316 327
 
317 328
 /**
318 329
  *
@@ -420,7 +431,10 @@ static void lcd_status_screen() {
420 431
 
421 432
 #if ENABLED(ULTIPANEL)
422 433
 
423
-static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
434
+static void lcd_return_to_status() {
435
+  defer_return_to_status = false;
436
+  lcd_goto_menu(lcd_status_screen);
437
+}
424 438
 
425 439
 #if ENABLED(SDSUPPORT)
426 440
 
@@ -536,7 +550,7 @@ void lcd_set_home_offsets() {
536 550
         babystepsTodo[axis] += distance;
537 551
       #endif
538 552
     }
539
-    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, "");
553
+    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL);
540 554
     if (LCD_CLICKED) lcd_goto_previous_menu();
541 555
   }
542 556
 
@@ -1140,7 +1154,7 @@ static void lcd_control_menu() {
1140 1154
       _PIDTEMP_BASE_FUNCTIONS(eindex); \
1141 1155
       void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); }
1142 1156
   #else
1143
-    #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex);
1157
+    #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex)
1144 1158
   #endif
1145 1159
 
1146 1160
   _PIDTEMP_FUNCTIONS(0);
@@ -1808,9 +1822,10 @@ int lcd_strlen_P(const char* s) {
1808 1822
 bool lcd_blink() {
1809 1823
   static uint8_t blink = 0;
1810 1824
   static millis_t next_blink_ms = 0;
1811
-  if (millis() >= next_blink_ms) {
1825
+  millis_t ms = millis();
1826
+  if (ms >= next_blink_ms) {
1812 1827
     blink ^= 0xFF;
1813
-    next_blink_ms = millis() + LCD_UPDATE_INTERVAL - 50;
1828
+    next_blink_ms = ms + 1000 - LCD_UPDATE_INTERVAL / 2;
1814 1829
   }
1815 1830
   return blink != 0;
1816 1831
 }
@@ -1956,13 +1971,7 @@ void lcd_update() {
1956 1971
     #if ENABLED(ULTIPANEL)
1957 1972
 
1958 1973
       // Return to Status Screen after a timeout
1959
-      if (currentMenu != lcd_status_screen &&
1960
-        #if ENABLED(MANUAL_BED_LEVELING)
1961
-          currentMenu != _lcd_level_bed &&
1962
-          currentMenu != _lcd_level_bed_homing &&
1963
-        #endif
1964
-        millis() > return_to_status_ms
1965
-      ) {
1974
+      if (!defer_return_to_status && currentMenu != lcd_status_screen && millis() > return_to_status_ms) {
1966 1975
         lcd_return_to_status();
1967 1976
         lcdDrawUpdate = 2;
1968 1977
       }
@@ -2219,11 +2228,11 @@ char* ftostr43(const float& x) {
2219 2228
   long xx = x * 1000;
2220 2229
   char *conv_ptr = conv;
2221 2230
   if (xx >= 0) {
2222
-    *conv_ptr++ = ' ';
2231
+    conv_ptr++;
2223 2232
   }
2224 2233
   else {
2225
-    conv[0] = '-';
2226 2234
     xx = -xx;
2235
+    conv[0] = '-';
2227 2236
   }
2228 2237
   conv[1] = (xx / 1000) % 10 + '0';
2229 2238
   conv[2] = '.';
@@ -2440,9 +2449,12 @@ char* ftostr52(const float& x) {
2440 2449
       if (max_software_endstops) NOMORE(current_position[Z_AXIS], Z_MAX_POS);
2441 2450
       encoderPosition = 0;
2442 2451
       line_to_current(Z_AXIS);
2443
-      lcdDrawUpdate = 2;
2452
+      lcdDrawUpdate = 1;
2453
+    }
2454
+    if (lcdDrawUpdate) {
2455
+      float v = current_position[Z_AXIS] - MESH_HOME_SEARCH_Z;
2456
+      lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43(v + (v < 0 ? -0.0001 : 0.0001)));
2444 2457
     }
2445
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Z"), ftostr43(current_position[Z_AXIS]));
2446 2458
     static bool debounce_click = false;
2447 2459
     if (LCD_CLICKED) {
2448 2460
       if (!debounce_click) {
@@ -2469,7 +2481,7 @@ char* ftostr52(const float& x) {
2469 2481
           current_position[X_AXIS] = mbl.get_x(ix);
2470 2482
           current_position[Y_AXIS] = mbl.get_y(iy);
2471 2483
           line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
2472
-          lcdDrawUpdate = 2;
2484
+          lcdDrawUpdate = 1;
2473 2485
         }
2474 2486
       }
2475 2487
     }
@@ -2482,7 +2494,8 @@ char* ftostr52(const float& x) {
2482 2494
    * MBL Move to mesh starting point
2483 2495
    */
2484 2496
   static void _lcd_level_bed_homing() {
2485
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), MSG_LEVEL_BED_HOMING);
2497
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2498
+    lcdDrawUpdate = 1;
2486 2499
     if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2487 2500
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2488 2501
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
@@ -2492,17 +2505,16 @@ char* ftostr52(const float& x) {
2492 2505
       _lcd_level_bed_position = 0;
2493 2506
       lcd_goto_menu(_lcd_level_bed);
2494 2507
     }
2495
-    lcdDrawUpdate = 2;
2496 2508
   }
2497 2509
 
2498 2510
   /**
2499 2511
    * MBL entry-point
2500 2512
    */
2501 2513
   static void lcd_level_bed() {
2514
+    defer_return_to_status = true;
2502 2515
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2503 2516
     mbl.reset();
2504 2517
     enqueue_and_echo_commands_P(PSTR("G28"));
2505
-    lcdDrawUpdate = 2;
2506 2518
     lcd_goto_menu(_lcd_level_bed_homing);
2507 2519
   }
2508 2520
 

+ 5
- 3
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -863,9 +863,11 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t
863 863
 void lcd_implementation_drawedit(const char* pstr, const char* value) {
864 864
   lcd.setCursor(1, 1);
865 865
   lcd_printPGM(pstr);
866
-  lcd.print(':');
867
-  lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
868
-  lcd_print(value);
866
+  if (value != NULL) {
867
+    lcd.print(':');
868
+    lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
869
+    lcd_print(value);
870
+  }
869 871
 }
870 872
 
871 873
 #if ENABLED(SDSUPPORT)

Loading…
Cancel
Save