From d8ef6faa8018ad2a807a7e16cb7e51172a9986d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Nov 2017 18:47:02 -0600 Subject: [PATCH] Cleanup for dogm_bitmaps --- Marlin/dogm_bitmaps.h | 47 ++++--------------------------------- Marlin/ultralcd_impl_DOGM.h | 4 ++-- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h index cf473cad9..3145cc67d 100644 --- a/Marlin/dogm_bitmaps.h +++ b/Marlin/dogm_bitmaps.h @@ -38,10 +38,8 @@ #if ENABLED(START_BMPHIGH) #define START_BMPWIDTH 112 #define START_BMPHEIGHT 38 - #define START_BMPBYTEWIDTH 14 - #define START_BMPBYTES 532 // START_BMPWIDTH * START_BMPHEIGHT / 8 - const unsigned char start_bmp[START_BMPBYTES] PROGMEM = { + const unsigned char start_bmp[] PROGMEM = { 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, @@ -83,10 +81,8 @@ #else #define START_BMPWIDTH 56 #define START_BMPHEIGHT 19 - #define START_BMPBYTEWIDTH 7 - #define START_BMPBYTES 133 // START_BMPWIDTH * START_BMPHEIGHT / 8 - const unsigned char start_bmp[START_BMPBYTES] PROGMEM = { + const unsigned char start_bmp[] PROGMEM = { 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, @@ -115,11 +111,11 @@ // When only one extruder is selected, the "1" on the symbol will not // be displayed. +#define STATUS_SCREENWIDTH 115 // Width in pixels +#define STATUS_SCREENHEIGHT 19 // Height in pixels + #if HAS_TEMP_BED #if HOTENDS == 1 - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -142,9 +138,6 @@ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -167,9 +160,6 @@ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; #elif HOTENDS == 2 - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -192,9 +182,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -217,9 +204,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; #else - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -242,9 +226,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -269,9 +250,6 @@ #endif // Extruders #else #if HOTENDS == 1 - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -294,9 +272,6 @@ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -319,9 +294,6 @@ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #elif HOTENDS == 2 - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -344,9 +316,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -369,9 +338,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #else - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, @@ -394,9 +360,6 @@ 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - #define STATUS_SCREENWIDTH 115 //Width in pixels - #define STATUS_SCREENHEIGHT 19 //Height in pixels - #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0, diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 57cf12dee..57f4b8330 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -312,7 +312,7 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { u8g.firstPage(); do { - u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); + u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1); @@ -492,7 +492,7 @@ static void lcd_implementation_status_screen() { if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { - u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT, + u8g.drawBitmapP(9, 1, (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, #if HAS_FAN0 blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp #else