From 92882fcc51f1397fe88252e192a3814b636393c1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Apr 2016 14:10:04 -0700 Subject: [PATCH] Allow lcd_implementation_drawedit to draw a message --- Marlin/dogm_lcd_implementation.h | 8 +++++--- Marlin/ultralcd.cpp | 4 ++-- Marlin/ultralcd_implementation_hitachi_HD44780.h | 8 +++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 25d573d820..5aa4cb70d9 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -562,9 +562,11 @@ void lcd_implementation_drawedit(const char* pstr, const char* value) { u8g.setPrintPos(0, rowHeight + kHalfChar); lcd_printPGM(pstr); - lcd_print(':'); - u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar); - lcd_print(value); + if (value != NULL) { + lcd_print(':'); + u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar); + lcd_print(value); + } } #if ENABLED(SDSUPPORT) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 51c0e12531..5b83f48d27 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -536,7 +536,7 @@ void lcd_set_home_offsets() { babystepsTodo[axis] += distance; #endif } - if (lcdDrawUpdate) lcd_implementation_drawedit(msg, ""); + if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL); if (LCD_CLICKED) lcd_goto_previous_menu(); } @@ -2482,7 +2482,7 @@ char* ftostr52(const float& x) { * MBL Move to mesh starting point */ static void _lcd_level_bed_homing() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), MSG_LEVEL_BED_HOMING); + if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ " MSG_LEVEL_BED_HOMING), NULL); if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) { current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index a8221d3a8c..9d10bce995 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -863,9 +863,11 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t void lcd_implementation_drawedit(const char* pstr, const char* value) { lcd.setCursor(1, 1); lcd_printPGM(pstr); - lcd.print(':'); - lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); - lcd_print(value); + if (value != NULL) { + lcd.print(':'); + lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); + lcd_print(value); + } } #if ENABLED(SDSUPPORT)