From b119c1401749037bc23352633f629268217ee5bf Mon Sep 17 00:00:00 2001 From: ANMay-ru <49490265+ANMay-ru@users.noreply.github.com> Date: Thu, 10 Oct 2019 08:41:44 +0700 Subject: [PATCH] Clean up LCD print, align (#15498) --- Marlin/src/lcd/menu/menu_mixer.cpp | 14 +++++++------- Marlin/src/lcd/menu/menu_motion.cpp | 4 ++-- Marlin/src/lcd/ultralcd.h | 4 ---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index bc3d2798f7..ab93c99965 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -53,7 +53,7 @@ strcpy_P(tmp, GET_TEXT(MSG_START_Z)); sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - LCDPRINT(tmp); + lcd_put_u8str(tmp); } if (ui.lcd_clicked) { @@ -79,7 +79,7 @@ strcpy_P(tmp, GET_TEXT(MSG_END_Z)); sprintf_P(tmp + strlen(tmp), PSTR(": %4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); SETCURSOR(2, (LCD_HEIGHT - 1) / 2); - LCDPRINT(tmp); + lcd_put_u8str(tmp); } if (ui.lcd_clicked) { @@ -106,13 +106,13 @@ SUBMENU(MSG_START_Z, lcd_mixer_gradient_z_start_edit); MENU_ITEM_ADDON_START(9); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.start_z), int(mixer.gradient.start_z * 10) % 10); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); SUBMENU(MSG_END_Z, lcd_mixer_gradient_z_end_edit); MENU_ITEM_ADDON_START(9); sprintf_P(tmp, PSTR("%4d.%d mm"), int(mixer.gradient.end_z), int(mixer.gradient.end_z * 10) % 10); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); END_MENU(); @@ -129,7 +129,7 @@ static uint8_t v_index; lcd_put_u8str_P(GET_TEXT(MSG_MIX)); SETCURSOR(LCD_WIDTH - 9, y); sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - LCDPRINT(tmp); + lcd_put_u8str(tmp); } #endif @@ -283,7 +283,7 @@ void menu_mixer() { MENU_ITEM_ADDON_START(10); mixer.update_mix_from_vtool(); sprintf_P(tmp, PSTR("%3d;%3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); ACTION_ITEM(MSG_TOGGLE_MIX, _lcd_mixer_toggle_mix); } @@ -299,7 +299,7 @@ void menu_mixer() { SUBMENU(MSG_GRADIENT, lcd_mixer_edit_gradient_menu); MENU_ITEM_ADDON_START(10); sprintf_P(tmp, PSTR("T%i->T%i"), mixer.gradient.start_vtool, mixer.gradient.end_vtool); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); ACTION_ITEM(MSG_REVERSE_GRADIENT, _lcd_mixer_reverse_gradient); } diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 7861dfb7ea..99342dd2d6 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -262,13 +262,13 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int SUBMENU(MSG_MOVE_01MM, [](){ _goto_manual_move( 0.1f); }); if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { SUBMENU_P(PSTR(""), []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); - MENU_ITEM_ADDON_START(1); + MENU_ITEM_ADDON_START(0); char tmp[20], numstr[10]; // Determine digits needed right of decimal const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 : !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2; sprintf_P(tmp, GET_TEXT(MSG_MOVE_Z_DIST), dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr)); - LCDPRINT(tmp); + lcd_put_u8str(tmp); MENU_ITEM_ADDON_END(); } } diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 0e27e7eb19..b963d90e54 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -67,13 +67,9 @@ #if HAS_GRAPHICAL_LCD #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) - #define LCDPRINT(p) u8g.print(p) - #define LCDWRITE(c) u8g.print(c) #else #define SETCURSOR(col, row) lcd_moveto(col, row) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - (len), row) - #define LCDPRINT(p) lcd_put_u8str(p) - #define LCDWRITE(c) lcd_put_wchar(c) #endif #include "lcdprint.h"