Browse Source

Allow lcd_implementation_drawedit to draw a message

Scott Lahteine 8 years ago
parent
commit
92882fcc51

+ 5
- 3
Marlin/dogm_lcd_implementation.h View File

@@ -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)

+ 2
- 2
Marlin/ultralcd.cpp View File

@@ -536,7 +536,7 @@ void lcd_set_home_offsets() {
536 536
         babystepsTodo[axis] += distance;
537 537
       #endif
538 538
     }
539
-    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, "");
539
+    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL);
540 540
     if (LCD_CLICKED) lcd_goto_previous_menu();
541 541
   }
542 542
 
@@ -2482,7 +2482,7 @@ char* ftostr52(const float& x) {
2482 2482
    * MBL Move to mesh starting point
2483 2483
    */
2484 2484
   static void _lcd_level_bed_homing() {
2485
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), MSG_LEVEL_BED_HOMING);
2485
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ " MSG_LEVEL_BED_HOMING), NULL);
2486 2486
     if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2487 2487
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2488 2488
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

+ 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