From ea897654a466d24d0511c331e6c1e6b12df1014f Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 21:53:58 +0200 Subject: [PATCH] Moved the definitions of the LCD_STR_* to Conditionals.h to avoid errors in Marlin_main.cpp. #1860 In the include tree of Marlin_main.cpp the decision between the display types is not made. To include the right LCD_STR_* ether 'dogm_lcd_implementation.h' or 'ultralcd_implementation_hitachi_HD44780.h' with all their code. A 'dogm_lcd_implementation.h.h' would be a curiosity. So i moved both of the definition blocks to conditionals.h On the long term it could make sense to use the same numbering for the u8glib and the hitachi symbols. --- Marlin/Conditionals.h | 43 ++++++++++++++++--- Marlin/dogm_lcd_implementation.h | 16 ------- .../ultralcd_implementation_hitachi_HD44780.h | 12 ------ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5d3213e0e..5b1024236 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -144,16 +144,45 @@ #endif #else //no panel but just LCD #ifdef ULTRA_LCD - #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display - #define LCD_WIDTH 22 - #define LCD_HEIGHT 5 - #else - #define LCD_WIDTH 16 - #define LCD_HEIGHT 2 - #endif + #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display + #define LCD_WIDTH 22 + #define LCD_HEIGHT 5 + #else + #define LCD_WIDTH 16 + #define LCD_HEIGHT 2 + #endif #endif #endif + #ifdef DOGLCD + /* Custom characters defined in font font_6x10_marlin_symbols */ + // \x00 intentionally skipped to avoid problems in strings + #define LCD_STR_REFRESH "\x01" + #define LCD_STR_FOLDER "\x02" + #define LCD_STR_ARROW_RIGHT "\x03" + #define LCD_STR_UPLEVEL "\x04" + #define LCD_STR_CLOCK "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_BEDTEMP "\x07" + #define LCD_STR_THERMOMETER "\x08" + #define LCD_STR_DEGREE "\x09" + + #define LCD_STR_SPECIAL_MAX '\x09' + // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. + // 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_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + #endif + /** * Default LCD contrast for dogm-like LCD displays */ diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 2a6d229b7..fd52d645e 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -108,22 +108,6 @@ #define START_ROW 0 -/* Custom characters defined in font font_6x10_marlin_symbols */ -// \x00 intentionally skipped to avoid problems in strings -#define LCD_STR_REFRESH "\x01" -#define LCD_STR_FOLDER "\x02" -#define LCD_STR_ARROW_RIGHT "\x03" -#define LCD_STR_UPLEVEL "\x04" -#define LCD_STR_CLOCK "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_BEDTEMP "\x07" -#define LCD_STR_THERMOMETER "\x08" -#define LCD_STR_DEGREE "\x09" - -#define LCD_STR_SPECIAL_MAX '\x09' -// Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin. -// Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - // LCD selection #ifdef U8GLIB_ST7920 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0); diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index 5698fd94b..aa348018e 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -201,18 +201,6 @@ #define LCD_STR_PROGRESS "\x03\x04\x05" #endif -/* 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_DEGREE "\x01" -#define LCD_STR_THERMOMETER "\x02" -#define LCD_STR_UPLEVEL "\x03" -#define LCD_STR_REFRESH "\x04" -#define LCD_STR_FOLDER "\x05" -#define LCD_STR_FEEDRATE "\x06" -#define LCD_STR_CLOCK "\x07" -//#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set. Only available on DISPLAY_CHARSET_HD44780_JAPAN - at this place!*/ -#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ - static void lcd_set_custom_characters( #ifdef LCD_PROGRESS_BAR bool progress_bar_set=true