Browse Source

Disable splash-screen when done once

Splash screen was shown with every display init.
That means every time the menus where entered.

Note the 2 in the initialisation.
The buffer is already written in two steps a 512 byte.
Without the 2 only the upper half is shown.
AnHardt 9 years ago
parent
commit
9865318f1c
1 changed files with 14 additions and 9 deletions
  1. 14
    9
      Marlin/dogm_lcd_implementation.h

+ 14
- 9
Marlin/dogm_lcd_implementation.h View File

@@ -186,6 +186,8 @@ char lcd_printPGM(const char* str) {
186 186
   return n;
187 187
 }
188 188
 
189
+static int8_t show_splashscreed = 2;
190
+
189 191
 static void lcd_implementation_init()
190 192
 {
191 193
   #ifdef LCD_PIN_BL // Enable LCD backlight
@@ -219,15 +221,18 @@ static void lcd_implementation_init()
219 221
 
220 222
 	u8g.firstPage();
221 223
 	do {
222
-    u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
223
-    lcd_setFont(FONT_MENU);
224
-    #ifndef STRING_SPLASH_LINE2
225
-      u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
226
-    #else
227
-      int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
228
-      u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
229
-      u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
230
-    #endif
224
+    if (show_splashscreed) {
225
+      u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
226
+      lcd_setFont(FONT_MENU);
227
+      #ifndef STRING_SPLASH_LINE2
228
+        u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
229
+      #else
230
+        int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
231
+        u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
232
+        u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
233
+      #endif
234
+      show_splashscreed--;
235
+    }
231 236
 	} while (u8g.nextPage());
232 237
 }
233 238
 

Loading…
Cancel
Save