From 7ee70c2248cfeb979dcb9c6d93ef0fd58fceec7a Mon Sep 17 00:00:00 2001 From: Maik Stohn Date: Tue, 28 May 2013 15:50:48 +0200 Subject: [PATCH 1/2] Fix: removed wrong ; at end of define --- Marlin/dogm_lcd_implementation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 6558556575..6b35b6aca9 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -101,11 +101,11 @@ static void lcd_implementation_init() u8g.setRot90(); // Rotate screen by 90° #endif -#ifdef LCD_SCREEN_ROT_180; +#ifdef LCD_SCREEN_ROT_180 u8g.setRot180(); // Rotate screen by 180° #endif -#ifdef LCD_SCREEN_ROT_270; +#ifdef LCD_SCREEN_ROT_270 u8g.setRot270(); // Rotate screen by 270° #endif From e8572c523999944b3fe66d24640110e660bc593e Mon Sep 17 00:00:00 2001 From: Maik Stohn Date: Tue, 28 May 2013 15:53:07 +0200 Subject: [PATCH 2/2] Fix: Long menu entries (>14 or >18 chars) caused overrun in hitachi display implementation --- Marlin/ultralcd_implementation_hitachi_HD44780.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index d4e9967414..2cf33d930b 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -503,7 +503,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c #endif lcd.setCursor(0, row); lcd.print(pre_char); - while((c = pgm_read_byte(pstr)) != '\0') + while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { lcd.print(c); pstr++; @@ -525,7 +525,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const #endif lcd.setCursor(0, row); lcd.print(pre_char); - while((c = pgm_read_byte(pstr)) != '\0') + while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { lcd.print(c); pstr++; @@ -547,7 +547,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons #endif lcd.setCursor(0, row); lcd.print(pre_char); - while((c = pgm_read_byte(pstr)) != '\0') + while( ((c = pgm_read_byte(pstr)) != '\0') && (n>0) ) { lcd.print(c); pstr++; @@ -617,7 +617,7 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* filename = longFilename; longFilename[LCD_WIDTH-1] = '\0'; } - while((c = *filename) != '\0') + while( ((c = *filename) != '\0') && (n>0) ) { lcd.print(c); filename++; @@ -637,7 +637,7 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, co filename = longFilename; longFilename[LCD_WIDTH-1] = '\0'; } - while((c = *filename) != '\0') + while( ((c = *filename) != '\0') && (n>0) ) { lcd.print(c); filename++; @@ -658,7 +658,7 @@ static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const filename = longFilename; longFilename[LCD_WIDTH-2] = '\0'; } - while((c = *filename) != '\0') + while( ((c = *filename) != '\0') && (n>0) ) { lcd.print(c); filename++; @@ -679,7 +679,7 @@ static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pst filename = longFilename; longFilename[LCD_WIDTH-2] = '\0'; } - while((c = *filename) != '\0') + while( ((c = *filename) != '\0') && (n>0) ) { lcd.print(c); filename++;