diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 427e16f306..b0a06195cd 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -218,7 +218,7 @@ #endif #if ENABLED(DOGLCD) - /* Custom characters defined in font font_6x10_marlin_symbols */ + /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */ // \x00 intentionally skipped to avoid problems in strings #define LCD_STR_REFRESH "\x01" #define LCD_STR_FOLDER "\x02" @@ -235,7 +235,7 @@ // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. #else /* Custom characters defined in the first 8 characters of the LCD */ - #define LCD_STR_BEDTEMP "\x00" // this will have 'unexpected' results when used in a string! + #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! #define LCD_STR_DEGREE "\x01" #define LCD_STR_THERMOMETER "\x02" #define LCD_STR_UPLEVEL "\x03" diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index b22a1ed672..a1281cf7ac 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -279,26 +279,51 @@ static void lcd_implementation_init() { static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop -static void _draw_heater_status(int x, int heater) { - bool isBed = heater < 0; - int y = 17 + (isBed ? 1 : 0); - - lcd_setFont(FONT_STATUSMENU); - u8g.setPrintPos(x, 7); - lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5))); +FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) { + int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width + u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter + lcd_print(itostr3(temp)); lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); - u8g.setPrintPos(x, 28); - lcd_print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5)); +} - lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); - if (heater >= 0 ? !isHeatingHotend(heater) : !isHeatingBed()) { - u8g.drawBox(x+7,y,2,2); - } - else { +FORCE_INLINE void _draw_heater_status(int x, int heater) { + #if HAS_TEMP_BED + bool isBed = heater < 0; + #else + const bool isBed = false; + #endif + + _draw_centered_temp((isBed ? degTargetBed() : degTargetHotend(heater)) + 0.5, x, 7); + + _draw_centered_temp((isBed ? degBed() : degHotend(heater)) + 0.5, x, 28); + + int h = isBed ? 7 : 8, + y = isBed ? 18 : 17; + if (isBed ? isHeatingBed() : isHeatingHotend(heater)) { u8g.setColorIndex(0); // white on black - u8g.drawBox(x + 7, y, 2, 2); + u8g.drawBox(x + h, y, 2, 2); u8g.setColorIndex(1); // black on white } + else { + u8g.drawBox(x + h, y, 2, 2); + } +} + +FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) { + if (blink) + lcd_printPGM(pstr); + else { + if (!axis_homed[axis]) + lcd_printPGM(PSTR("?")); + else { + #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + if (!axis_known_position[axis]) + lcd_printPGM(PSTR(" ")); + else + #endif + lcd_printPGM(pstr); + } + } } static void lcd_implementation_status_screen() { @@ -315,6 +340,9 @@ static void lcd_implementation_status_screen() { #endif ); + // Status Menu Font for SD info, Heater status, Fan, XYZ + lcd_setFont(FONT_STATUSMENU); + #if ENABLED(SDSUPPORT) // SD Card Symbol u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); @@ -326,8 +354,6 @@ static void lcd_implementation_status_screen() { u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION)); // SD Card Progress bar and clock - lcd_setFont(FONT_STATUSMENU); - if (IS_SD_PRINTING) { // Progress bar solid part u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION)); @@ -340,19 +366,17 @@ static void lcd_implementation_status_screen() { lcd_print(':'); lcd_print(itostr2(time%60)); } - else { - lcd_printPGM(PSTR("--:--")); - } #endif // Extruders - for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(6 + i * 25, i); + for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(5 + i * 25, i); - // Heatbed - if (EXTRUDERS < 4) _draw_heater_status(81, -1); + // Heated bed + #if EXTRUDERS < 4 && HAS_TEMP_BED + _draw_heater_status(81, -1); + #endif // Fan - lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(104, 27); #if HAS_FAN0 int per = ((fanSpeeds[0] + 1) * 100) / 256; @@ -360,18 +384,13 @@ static void lcd_implementation_status_screen() { lcd_print(itostr3(per)); lcd_print('%'); } - else #endif - { - lcd_printPGM(PSTR("---")); - } // X, Y, Z-Coordinates // Before homing the axis letters are blinking 'X' <-> '?'. // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '. // When everything is ok you see a constant 'X'. #define XYZ_BASELINE 38 - lcd_setFont(FONT_STATUSMENU); #if ENABLED(USE_SMALL_INFOFONT) u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 10); @@ -379,78 +398,35 @@ static void lcd_implementation_status_screen() { u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 9); #endif u8g.setColorIndex(0); // white on black + u8g.setPrintPos(2, XYZ_BASELINE); - if (blink) - lcd_printPGM(PSTR(MSG_X)); - else { - if (!axis_homed[X_AXIS]) - lcd_printPGM(PSTR("?")); - else { - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[X_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR(MSG_X)); - } - } - u8g.drawPixel(8, XYZ_BASELINE - 5); - u8g.drawPixel(8, XYZ_BASELINE - 3); + _draw_axis_label(X_AXIS, PSTR(MSG_X), blink); u8g.setPrintPos(10, XYZ_BASELINE); - lcd_print(ftostr31ns(current_position[X_AXIS])); + lcd_print(ftostr4sign(current_position[X_AXIS])); u8g.setPrintPos(43, XYZ_BASELINE); - if (blink) - lcd_printPGM(PSTR(MSG_Y)); - else { - if (!axis_homed[Y_AXIS]) - lcd_printPGM(PSTR("?")); - else { - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[Y_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR(MSG_Y)); - } - } - u8g.drawPixel(49, XYZ_BASELINE - 5); - u8g.drawPixel(49, XYZ_BASELINE - 3); + _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink); u8g.setPrintPos(51, XYZ_BASELINE); - lcd_print(ftostr31ns(current_position[Y_AXIS])); + lcd_print(ftostr4sign(current_position[Y_AXIS])); u8g.setPrintPos(83, XYZ_BASELINE); - if (blink) - lcd_printPGM(PSTR(MSG_Z)); - else { - if (!axis_homed[Z_AXIS]) - lcd_printPGM(PSTR("?")); - else { - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[Z_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR(MSG_Z)); - } - } - u8g.drawPixel(89, XYZ_BASELINE - 5); - u8g.drawPixel(89, XYZ_BASELINE - 3); + _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); u8g.setPrintPos(91, XYZ_BASELINE); - lcd_print(ftostr32sp(current_position[Z_AXIS])); + lcd_print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); + u8g.setColorIndex(1); // black on white // Feedrate lcd_setFont(FONT_MENU); u8g.setPrintPos(3, 49); lcd_print(LCD_STR_FEEDRATE[0]); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12, 49); lcd_print(itostr3(feedrate_multiplier)); lcd_print('%'); // Status line - lcd_setFont(FONT_STATUSMENU); #if ENABLED(USE_SMALL_INFOFONT) u8g.setPrintPos(0, 62); #else diff --git a/Marlin/fonts/README.fonts b/Marlin/fonts/README.fonts deleted file mode 100644 index 7ae6e4242c..0000000000 --- a/Marlin/fonts/README.fonts +++ /dev/null @@ -1,23 +0,0 @@ -The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience). -In Fony export the fonts to bdf-format. Maybe another one can edit them with Fontforge. -Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files. -The .h files must be edited to replace '#include "u8g.h"' with '#include ', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', insert '.progmem.' right behind the first '"' and moved to the main directory. - -How to integrate a new font: -Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more than 10 pixel height for the symbols. For up to 11 pixel set TALL_FONT_CORRECTION 1 when loading the font. -To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. -For the second half of the font we now support up to 11x11 pixel. - - * Get 'Fony.exe' - * Copy one of the existing *.fon files and work with this. - * Change the pixels. Don't change width or height. - * Export as *.bdf - * Use 'bdf2u8g.exe' to produce the *.h file. Examples for the existing fonts are in 'make_fonts.bat' - * Edit the produced .h file to match our needs. See hints in 'README.fonts' or the other 'dogm_font_data_.h' files. - * Make a new entry in the font list in 'dogm_lcd_implementation.h' before the '#else // fall back' - #elif ENABLED(DISPLAY_CHARSET_NEWNAME) - #include "dogm_font_data_yourfont.h" - #define FONT_MENU_NAME YOURFONTNAME - #else // fall-back - * Add your font to the list of permitted fonts in 'language_en.h' - ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) diff --git a/Marlin/fonts/README.md b/Marlin/fonts/README.md new file mode 100644 index 0000000000..86e54929b3 --- /dev/null +++ b/Marlin/fonts/README.md @@ -0,0 +1,30 @@ +The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience). + +In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved: +- Replace `#include "u8g.h"` with `#include `, +- Replace `U8G_FONT_SECTION` with `U8G_SECTION`, +- Insert `.progmem.` right after the first quote `"`, +- Move the file to the main directory. + +How to integrate a new font: +Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font. +To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. +For the second half of the font we now support up to 11x11 pixel. + +- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony) +- Copy one of the existing `*.fon` files and use the copy for your work. +- Only change the pixels. Don't change width or height. +- Export as a `*.bdf` file +- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`. +- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files. +- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line: +```cpp + #elif ENABLED(DISPLAY_CHARSET_NEWNAME) + #include "dogm_font_data_yourfont.h" + #define FONT_MENU_NAME YOURFONTNAME + #else // fall-back +``` +- Add your font to the list of permitted fonts in 'language_en.h' +```cpp + ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) +``` \ No newline at end of file diff --git a/Marlin/language_an.h b/Marlin/language_an.h index ea476d69f8..c2d49fb25d 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ves-jerk" #define MSG_VMAX "Vmax" -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "y" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax" diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index abff7baa7b..f44865770d 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -94,10 +94,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 783d088787..95ded7488c 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -94,10 +94,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 95c794afd5..487f723562 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -92,10 +92,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index db82d7d97e..0dc7f41fec 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -99,10 +99,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 4d9b46f2b4..04477074d9 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -95,10 +95,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_de.h b/Marlin/language_de.h index a4fba0bf66..06d718c7e5 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -95,10 +95,10 @@ #define MSG_VZ_JERK "V z Ruck" #define MSG_VE_JERK "V e Ruck" #define MSG_VMAX "V max " // space by purpose -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "V min" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "A max " // space by purpose diff --git a/Marlin/language_en.h b/Marlin/language_en.h index c213fb5961..18ea1cbdbc 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -272,16 +272,16 @@ #define MSG_VMAX "Vmax " #endif #ifndef MSG_X - #define MSG_X "x" + #define MSG_X "X" #endif #ifndef MSG_Y - #define MSG_Y "y" + #define MSG_Y "Y" #endif #ifndef MSG_Z - #define MSG_Z "z" + #define MSG_Z "Z" #endif #ifndef MSG_E - #define MSG_E "e" + #define MSG_E "E" #endif #ifndef MSG_VMIN #define MSG_VMIN "Vmin" diff --git a/Marlin/language_es.h b/Marlin/language_es.h index 0032de8fd0..e54ce3cccb 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -94,10 +94,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax" -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "Vel. viaje min" #define MSG_AMAX "Acel. max" diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 8158d2654e..51600f8b43 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "Vz-astindua" #define MSG_VE_JERK "Ve-astindua" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 600a009feb..a1915fd3b0 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VLiike min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index acb17ce3fb..1b3be6b4ec 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -95,10 +95,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax" -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "Vdepl min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 0921bbf2ab..beafa84d53 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -92,10 +92,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 247030e9e7..59aeb233fc 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -94,10 +94,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 953cc33422..b24fce3b7d 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 71c8730485..c75b38f309 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "Zryw Vz" #define MSG_VE_JERK "Zryw Ve" #define MSG_VMAX "Vmax" -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "Vskok min" #define MSG_AMAX "Amax" diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 693a6413d8..fc58a06d00 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "jogo VZ" #define MSG_VE_JERK "jogo VE" #define MSG_VMAX " Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index 15a618b658..d086908979 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -93,10 +93,10 @@ #define MSG_VZ_JERK "jogo VZ" #define MSG_VE_JERK "jogo VE" #define MSG_VMAX " Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index 31617ee935..f82dd7baeb 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -98,10 +98,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX " Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index e94fa323ee..c254f720d8 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -98,10 +98,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX " Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax " diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 051c9289af..d20651d1f9 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -94,10 +94,10 @@ #define MSG_VZ_JERK "Vz-jerk" #define MSG_VE_JERK "Ve-jerk" #define MSG_VMAX "Vmax " -#define MSG_X "x" -#define MSG_Y "y" -#define MSG_Z "z" -#define MSG_E "e" +#define MSG_X "X" +#define MSG_Y "Y" +#define MSG_Z "Z" +#define MSG_E "E" #define MSG_VMIN "Vmin" #define MSG_VTRAV_MIN "VTrav min" #define MSG_AMAX "Amax" diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 6acfdd0ba6..3787db01bd 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -569,6 +569,23 @@ unsigned lcd_print(char c) { return charset_mapper(c); } #endif // SHOW_BOOTSCREEN +FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) { + if (blink) + lcd_printPGM(pstr); + else { + if (!axis_homed[axis]) + lcd_printPGM(PSTR("?")); + else { + #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + if (!axis_known_position[axis]) + lcd_printPGM(PSTR(" ")); + else + #endif + lcd_printPGM(pstr); + } + } +} + /** Possible status screens: 16x2 |000/000 B000/000| @@ -692,36 +709,12 @@ static void lcd_implementation_status_screen() { // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '. // When everything is ok you see a constant 'X'. - if (blink) - lcd_printPGM(PSTR("X")); - else { - if (!axis_homed[X_AXIS]) - lcd_printPGM(PSTR("?")); - else - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[X_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR("X")); - } - + _draw_axis_label(X_AXIS, PSTR(MSG_X), blink); lcd.print(ftostr4sign(current_position[X_AXIS])); lcd_printPGM(PSTR(" ")); - if (blink) - lcd_printPGM(PSTR("Y")); - else { - if (!axis_homed[Y_AXIS]) - lcd_printPGM(PSTR("?")); - else - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[Y_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR("Y")); - } + + _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink); lcd.print(ftostr4sign(current_position[Y_AXIS])); #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 @@ -729,19 +722,7 @@ static void lcd_implementation_status_screen() { #endif // LCD_WIDTH >= 20 lcd.setCursor(LCD_WIDTH - 8, 1); - if (blink) - lcd_printPGM(PSTR("Z")); - else { - if (!axis_homed[Z_AXIS]) - lcd_printPGM(PSTR("?")); - else - #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - if (!axis_known_position[Z_AXIS]) - lcd_printPGM(PSTR(" ")); - else - #endif - lcd_printPGM(PSTR("Z")); - } + _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink); lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); #endif // LCD_HEIGHT > 2