Browse Source

Fix boot screen warning

Scott Lahteine 6 years ago
parent
commit
5c0e5c599f
1 changed files with 10 additions and 9 deletions
  1. 10
    9
      Marlin/src/lcd/dogm/ultralcd_DOGM.cpp

+ 10
- 9
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

168
     // Determine text space needed
168
     // Determine text space needed
169
     #ifndef STRING_SPLASH_LINE2
169
     #ifndef STRING_SPLASH_LINE2
170
       constexpr u8g_uint_t text_total_height = MENU_FONT_HEIGHT,
170
       constexpr u8g_uint_t text_total_height = MENU_FONT_HEIGHT,
171
-                           text_width_1 = u8g_uint_t(sizeof(STRING_SPLASH_LINE1) - 1) * u8g_uint_t(MENU_FONT_WIDTH),
172
                            text_width_2 = 0;
171
                            text_width_2 = 0;
173
     #else
172
     #else
174
-      constexpr u8g_uint_t text_total_height = u8g_uint_t(MENU_FONT_HEIGHT) * 2,
175
-                           text_width_1 = u8g_uint_t(sizeof(STRING_SPLASH_LINE1) - 1) * u8g_uint_t(MENU_FONT_WIDTH),
176
-                           text_width_2 = u8g_uint_t(sizeof(STRING_SPLASH_LINE2) - 1) * u8g_uint_t(MENU_FONT_WIDTH);
173
+      constexpr u8g_uint_t text_total_height = (MENU_FONT_HEIGHT) * 2,
174
+                           text_width_2 = u8g_uint_t((sizeof(STRING_SPLASH_LINE2) - 1) * (MENU_FONT_WIDTH));
177
     #endif
175
     #endif
178
-    constexpr u8g_uint_t text_max_width = _MAX(text_width_1, text_width_2),
176
+    constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(STRING_SPLASH_LINE1) - 1) * (MENU_FONT_WIDTH)),
177
+                         text_max_width = _MAX(text_width_1, text_width_2),
179
                          rspace = width - (START_BMPWIDTH);
178
                          rspace = width - (START_BMPWIDTH);
180
 
179
 
181
     u8g_int_t offx, offy, txt_base, txt_offx_1, txt_offx_2;
180
     u8g_int_t offx, offy, txt_base, txt_offx_1, txt_offx_2;
199
     NOLESS(offx, 0);
198
     NOLESS(offx, 0);
200
     NOLESS(offy, 0);
199
     NOLESS(offy, 0);
201
 
200
 
202
-    auto draw_bootscreen_bmp = [offx, offy, txt_base, txt_offx_1, txt_offx_2](const uint8_t *bitmap) {
201
+    auto draw_bootscreen_bmp = [&](const uint8_t *bitmap) {
203
       u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap);
202
       u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap);
204
       set_font(FONT_MENU);
203
       set_font(FONT_MENU);
204
+      const u8g_pgm_uint8_t splash1[] U8G_PROGMEM  = STRING_SPLASH_LINE1;
205
       #ifndef STRING_SPLASH_LINE2
205
       #ifndef STRING_SPLASH_LINE2
206
-        u8g.drawStr(txt_offx_1, txt_base, STRING_SPLASH_LINE1);
206
+        u8g.drawStrP(txt_offx_1, txt_base, splash1);
207
       #else
207
       #else
208
-        u8g.drawStr(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), STRING_SPLASH_LINE1);
209
-        u8g.drawStr(txt_offx_2, txt_base, STRING_SPLASH_LINE2);
208
+        const u8g_pgm_uint8_t splash2[] U8G_PROGMEM  = STRING_SPLASH_LINE2;
209
+        u8g.drawStrP(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), splash1);
210
+        u8g.drawStrP(txt_offx_2, txt_base, splash2);
210
       #endif
211
       #endif
211
     };
212
     };
212
 
213
 

Loading…
Cancel
Save