Browse Source

Small / Large Boot Screen option for TFT_COLOR_UI (#20578)

Keith Bennett 3 years ago
parent
commit
cfcfc8047a
No account linked to committer's email address

+ 3
- 1
Marlin/Configuration_adv.h View File

@@ -1140,6 +1140,9 @@
1140 1140
 
1141 1141
   #if ENABLED(SHOW_BOOTSCREEN)
1142 1142
     #define BOOTSCREEN_TIMEOUT 4000      // (ms) Total Duration to display the boot screen(s)
1143
+    #if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
1144
+      #define BOOT_MARLIN_LOGO_SMALL     // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
1145
+    #endif
1143 1146
   #endif
1144 1147
 
1145 1148
   // Scroll a longer status message into view
@@ -1450,7 +1453,6 @@
1450 1453
   //#define STATUS_ALT_FAN_BITMAP     // Use the alternative fan bitmap
1451 1454
   //#define STATUS_FAN_FRAMES 3       // :[0,1,2,3,4] Number of fan animation frames
1452 1455
   //#define STATUS_HEAT_PERCENT       // Show heating in a progress bar
1453
-  //#define BOOT_MARLIN_LOGO_SMALL    // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash)
1454 1456
   //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM.
1455 1457
 
1456 1458
   // Frivolous Game Options

+ 13
- 3
Marlin/src/lcd/tft/ui_320x240.cpp View File

@@ -92,10 +92,20 @@ void MarlinUI::clear_lcd() {
92 92
     tft.queue.reset();
93 93
 
94 94
     tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT);
95
-    tft.add_image(0, 0, imgBootScreen);  // MarlinLogo320x240x16
96
-
95
+    #if ENABLED(BOOT_MARLIN_LOGO_SMALL)
96
+      #define BOOT_LOGO_W 195   // MarlinLogo195x59x16
97
+      #define BOOT_LOGO_H  59
98
+      #define SITE_URL_Y (TFT_HEIGHT - 46)
99
+      tft.set_background(COLOR_BACKGROUND);
100
+    #else
101
+      #define BOOT_LOGO_W 320   // MarlinLogo320x240x16
102
+      #define BOOT_LOGO_H 240
103
+      #define SITE_URL_Y (TFT_HEIGHT - 52)
104
+    #endif
105
+    tft.add_image((TFT_WIDTH - BOOT_LOGO_W) / 2, (TFT_HEIGHT - BOOT_LOGO_H) / 2, imgBootScreen);
97 106
     #ifdef WEBSITE_URL
98
-      tft.add_text(4, 188, COLOR_WEBSITE_URL, WEBSITE_URL);
107
+      tft_string.set(WEBSITE_URL);
108
+      tft.add_text(tft_string.center(TFT_WIDTH), SITE_URL_Y, COLOR_WEBSITE_URL, tft_string);
99 109
     #endif
100 110
 
101 111
     tft.queue.sync();

+ 1
- 1
Marlin/src/lcd/tft/ui_320x240.h View File

@@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false);
44 44
 #define ABSOLUTE_ZERO     -273.15
45 45
 
46 46
 const tImage Images[imgCount] = {
47
-  MarlinLogo320x240x16,
47
+  TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo320x240x16),
48 48
   HotEnd_64x64x4,
49 49
   Bed_64x64x4,
50 50
   Bed_Heated_64x64x4,

+ 13
- 7
Marlin/src/lcd/tft/ui_480x320.cpp View File

@@ -90,18 +90,24 @@ void MarlinUI::clear_lcd() {
90 90
 }
91 91
 
92 92
 #if ENABLED(SHOW_BOOTSCREEN)
93
-  #undef BOOTSCREEN_TIMEOUT
94
-  #define BOOTSCREEN_TIMEOUT 5000
95
-
96 93
   void MarlinUI::show_bootscreen() {
97 94
     tft.queue.reset();
98 95
 
99 96
     tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT);
100
-    tft.set_background(COLOR_BACKGROUND);
101
-    tft.add_image(142, 130, imgBootScreen);  // MarlinLogo195x59x16
102
-
97
+    #if ENABLED(BOOT_MARLIN_LOGO_SMALL)
98
+      #define BOOT_LOGO_W 195   // MarlinLogo195x59x16
99
+      #define BOOT_LOGO_H  59
100
+      #define SITE_URL_Y (TFT_HEIGHT - 70)
101
+      tft.set_background(COLOR_BACKGROUND);
102
+    #else
103
+      #define BOOT_LOGO_W 480   // MarlinLogo480x320x16
104
+      #define BOOT_LOGO_H 320
105
+      #define SITE_URL_Y (TFT_HEIGHT - 90)
106
+    #endif
107
+    tft.add_image((TFT_WIDTH - BOOT_LOGO_W) / 2, (TFT_HEIGHT - BOOT_LOGO_H) / 2, imgBootScreen);
103 108
     #ifdef WEBSITE_URL
104
-      tft.add_text(8, 250, COLOR_WEBSITE_URL, WEBSITE_URL);
109
+      tft_string.set(WEBSITE_URL);
110
+      tft.add_text(tft_string.center(TFT_WIDTH), SITE_URL_Y, COLOR_WEBSITE_URL, tft_string);
105 111
     #endif
106 112
 
107 113
     tft.queue.sync();

+ 1
- 1
Marlin/src/lcd/tft/ui_480x320.h View File

@@ -44,7 +44,7 @@ void menu_item(const uint8_t row, bool sel = false);
44 44
 #define ABSOLUTE_ZERO     -273.15
45 45
 
46 46
 const tImage Images[imgCount] = {
47
-  MarlinLogo195x59x16,
47
+  TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16),
48 48
   HotEnd_64x64x4,
49 49
   Bed_64x64x4,
50 50
   Bed_Heated_64x64x4,

Loading…
Cancel
Save