From 65642592eef1a3a20424c56561c84476befaabc4 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 3 Feb 2015 12:25:36 +0100 Subject: [PATCH] Added dualline version. --- Marlin/Configuration.h | 3 ++- Marlin/dogm_lcd_implementation.h | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 10988be83..613a79d29 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -42,7 +42,8 @@ Here are some standard links for getting your machine calibrated: #define STRING_URL "reprap.org" #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define STRING_SPLASH "v" STRING_VERSION // will be shown during bootup +#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1 +//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2 // SERIAL_PORT selects which serial port should be used for communication with the host. // This allows the connection of wireless adapters (for instance) to non-default port pins. diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 7b7c31994..c5d10e17b 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -114,14 +114,20 @@ static void lcd_implementation_init() #else int offy = DOG_CHAR_HEIGHT; #endif - int txtX = (u8g.getWidth() - (sizeof(STRING_SPLASH) - 1)*DOG_CHAR_WIDTH) / 2; - int txtY = u8g.getHeight() - DOG_CHAR_HEIGHT; + + int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2; + u8g.firstPage(); do { - u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); - + u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); u8g.setFont(u8g_font_6x10_marlin); - u8g.drawStr(txtX, txtY, STRING_SPLASH); + #ifndef STRING_SPLASH_LINE2 + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); + #else + int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; + u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1); + u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2); + #endif } while(u8g.nextPage()); }