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
 
1140
 
1141
   #if ENABLED(SHOW_BOOTSCREEN)
1141
   #if ENABLED(SHOW_BOOTSCREEN)
1142
     #define BOOTSCREEN_TIMEOUT 4000      // (ms) Total Duration to display the boot screen(s)
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
   #endif
1146
   #endif
1144
 
1147
 
1145
   // Scroll a longer status message into view
1148
   // Scroll a longer status message into view
1450
   //#define STATUS_ALT_FAN_BITMAP     // Use the alternative fan bitmap
1453
   //#define STATUS_ALT_FAN_BITMAP     // Use the alternative fan bitmap
1451
   //#define STATUS_FAN_FRAMES 3       // :[0,1,2,3,4] Number of fan animation frames
1454
   //#define STATUS_FAN_FRAMES 3       // :[0,1,2,3,4] Number of fan animation frames
1452
   //#define STATUS_HEAT_PERCENT       // Show heating in a progress bar
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
   //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM.
1456
   //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM.
1455
 
1457
 
1456
   // Frivolous Game Options
1458
   // Frivolous Game Options

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

92
     tft.queue.reset();
92
     tft.queue.reset();
93
 
93
 
94
     tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT);
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
     #ifdef WEBSITE_URL
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
     #endif
109
     #endif
100
 
110
 
101
     tft.queue.sync();
111
     tft.queue.sync();

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

44
 #define ABSOLUTE_ZERO     -273.15
44
 #define ABSOLUTE_ZERO     -273.15
45
 
45
 
46
 const tImage Images[imgCount] = {
46
 const tImage Images[imgCount] = {
47
-  MarlinLogo320x240x16,
47
+  TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo320x240x16),
48
   HotEnd_64x64x4,
48
   HotEnd_64x64x4,
49
   Bed_64x64x4,
49
   Bed_64x64x4,
50
   Bed_Heated_64x64x4,
50
   Bed_Heated_64x64x4,

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

90
 }
90
 }
91
 
91
 
92
 #if ENABLED(SHOW_BOOTSCREEN)
92
 #if ENABLED(SHOW_BOOTSCREEN)
93
-  #undef BOOTSCREEN_TIMEOUT
94
-  #define BOOTSCREEN_TIMEOUT 5000
95
-
96
   void MarlinUI::show_bootscreen() {
93
   void MarlinUI::show_bootscreen() {
97
     tft.queue.reset();
94
     tft.queue.reset();
98
 
95
 
99
     tft.canvas(0, 0, TFT_WIDTH, TFT_HEIGHT);
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
     #ifdef WEBSITE_URL
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
     #endif
111
     #endif
106
 
112
 
107
     tft.queue.sync();
113
     tft.queue.sync();

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

44
 #define ABSOLUTE_ZERO     -273.15
44
 #define ABSOLUTE_ZERO     -273.15
45
 
45
 
46
 const tImage Images[imgCount] = {
46
 const tImage Images[imgCount] = {
47
-  MarlinLogo195x59x16,
47
+  TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MarlinLogo480x320x16),
48
   HotEnd_64x64x4,
48
   HotEnd_64x64x4,
49
   Bed_64x64x4,
49
   Bed_64x64x4,
50
   Bed_Heated_64x64x4,
50
   Bed_Heated_64x64x4,

Loading…
Cancel
Save