Browse Source

Allow lcd_implementation_drawedit to draw a message

pull/1/head
Scott Lahteine 9 years ago
parent
commit
92882fcc51
  1. 8
      Marlin/dogm_lcd_implementation.h
  2. 4
      Marlin/ultralcd.cpp
  3. 8
      Marlin/ultralcd_implementation_hitachi_HD44780.h

8
Marlin/dogm_lcd_implementation.h

@ -562,9 +562,11 @@ void lcd_implementation_drawedit(const char* pstr, const char* value) {
u8g.setPrintPos(0, rowHeight + kHalfChar); u8g.setPrintPos(0, rowHeight + kHalfChar);
lcd_printPGM(pstr); lcd_printPGM(pstr);
lcd_print(':'); if (value != NULL) {
u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar); lcd_print(':');
lcd_print(value); u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
lcd_print(value);
}
} }
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)

4
Marlin/ultralcd.cpp

@ -536,7 +536,7 @@ void lcd_set_home_offsets() {
babystepsTodo[axis] += distance; babystepsTodo[axis] += distance;
#endif #endif
} }
if (lcdDrawUpdate) lcd_implementation_drawedit(msg, ""); if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL);
if (LCD_CLICKED) lcd_goto_previous_menu(); if (LCD_CLICKED) lcd_goto_previous_menu();
} }
@ -2482,7 +2482,7 @@ char* ftostr52(const float& x) {
* MBL Move to mesh starting point * MBL Move to mesh starting point
*/ */
static void _lcd_level_bed_homing() { 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]) { if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z; 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]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

8
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) { void lcd_implementation_drawedit(const char* pstr, const char* value) {
lcd.setCursor(1, 1); lcd.setCursor(1, 1);
lcd_printPGM(pstr); lcd_printPGM(pstr);
lcd.print(':'); if (value != NULL) {
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1); lcd.print(':');
lcd_print(value); lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
lcd_print(value);
}
} }
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)

Loading…
Cancel
Save