Browse Source

Merge pull request #1457 from AnHardt/bootsplash

Reworked bootsplash for DOGM displays another time - saved 1786 bytes
Scott Lahteine 9 years ago
parent
commit
04ce708031

+ 2
- 1
Marlin/Configuration.h View File

42
 #define STRING_URL "reprap.org"
42
 #define STRING_URL "reprap.org"
43
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
43
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
44
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
44
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
45
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
45
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
46
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
46
 
47
 
47
 // SERIAL_PORT selects which serial port should be used for communication with the host.
48
 // SERIAL_PORT selects which serial port should be used for communication with the host.
48
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
49
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 3
- 1
Marlin/DOGMbitmaps.h View File

1
 // BitMap for splashscreen
1
 // BitMap for splashscreen
2
 // Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
2
 // Generated with: http://www.digole.com/tools/PicturetoC_Hex_converter.php
3
-// Please note that using the high-res version takes about 0.5KB of 
3
+// Please note that using the high-res version takes 402Bytes of PROGMEM. 
4
+//#define START_BMPHIGH
5
+
4
 #ifdef START_BMPHIGH
6
 #ifdef START_BMPHIGH
5
   #define START_BMPWIDTH      112
7
   #define START_BMPWIDTH      112
6
   #define START_BMPHEIGHT      38
8
   #define START_BMPHEIGHT      38

+ 36
- 24
Marlin/dogm_lcd_implementation.h View File

51
 #endif
51
 #endif
52
 */
52
 */
53
 
53
 
54
+#define USE_BIG_EDIT_FONT
55
+#define FONT_STATUSMENU u8g_font_6x9
56
+#define FONT_MENU u8g_font_6x10_marlin
57
+
54
 // DOGM parameters (size in pixels)
58
 // DOGM parameters (size in pixels)
55
 #define DOG_CHAR_WIDTH         6
59
 #define DOG_CHAR_WIDTH         6
56
 #define DOG_CHAR_HEIGHT        12
60
 #define DOG_CHAR_HEIGHT        12
57
-#define DOG_CHAR_WIDTH_LARGE   9
58
-#define DOG_CHAR_HEIGHT_LARGE  18
61
+#ifdef USE_BIG_EDIT_FONT
62
+  #define FONT_MENU_EDIT u8g_font_9x18
63
+  #define DOG_CHAR_WIDTH_EDIT  9
64
+  #define DOG_CHAR_HEIGHT_EDIT 18
65
+  #define LCD_WIDTH_EDIT       14
66
+#else
67
+  #define FONT_MENU_EDIT u8g_font_6x10_marlin
68
+  #define DOG_CHAR_WIDTH_EDIT 6
69
+  #define DOG_CHAR_HEIGHT_EDIT 12
70
+  #define LCD_WIDTH_EDIT 22
71
+#endif
59
 
72
 
60
 #define START_ROW              0
73
 #define START_ROW              0
61
 
74
 
70
 #define LCD_STR_BEDTEMP     "\xFE"
83
 #define LCD_STR_BEDTEMP     "\xFE"
71
 #define LCD_STR_THERMOMETER "\xFF"
84
 #define LCD_STR_THERMOMETER "\xFF"
72
 
85
 
73
-#define FONT_STATUSMENU u8g_font_6x9
74
-
75
 int lcd_contrast;
86
 int lcd_contrast;
76
 
87
 
77
 // LCD selection
88
 // LCD selection
107
 	u8g.setRot270();	// Rotate screen by 270°
118
 	u8g.setRot270();	// Rotate screen by 270°
108
 #endif
119
 #endif
109
 	
120
 	
110
-  // FIXME: whats the purpose of the box? Maybe clear screen?
111
-	u8g.firstPage();
112
-  do {
113
-		u8g.setFont(u8g_font_6x10_marlin);
114
-		u8g.setColorIndex(1);
115
-		u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
116
-		u8g.setColorIndex(1);
117
-	} while(u8g.nextPage());
118
-
119
   // Show splashscreen
121
   // Show splashscreen
120
   int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
122
   int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
121
-  int offy = (u8g.getHeight() - 18 - START_BMPHEIGHT) / 2;
122
-  int txtX = (u8g.getWidth() - (sizeof(STRING_SPLASH) - 1)*5) / 2; // 5 is fontwidth in pixel
123
-  int txtY = u8g.getHeight() - 10;
123
+  #ifdef START_BMPHIGH
124
+    int offy = 0;
125
+  #else
126
+    int offy = DOG_CHAR_HEIGHT;
127
+  #endif
128
+
129
+  int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1)*DOG_CHAR_WIDTH) / 2;
130
+
124
 	u8g.firstPage();
131
 	u8g.firstPage();
125
 	do {
132
 	do {
126
-	  u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
127
-			
128
-    u8g.setFont(u8g_font_5x8);
129
-		u8g.drawStr(txtX, txtY, STRING_SPLASH);
133
+    u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
134
+    u8g.setFont(FONT_MENU);
135
+    #ifndef STRING_SPLASH_LINE2
136
+      u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
137
+    #else
138
+      int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
139
+      u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT*3/2, STRING_SPLASH_LINE1);
140
+      u8g.drawStr(txt2X, u8g.getHeight() - DOG_CHAR_HEIGHT*1/2, STRING_SPLASH_LINE2);
141
+    #endif
130
 	} while(u8g.nextPage());
142
 	} while(u8g.nextPage());
131
 }
143
 }
132
 
144
 
244
   u8g.setColorIndex(1); // black on white
256
   u8g.setColorIndex(1); // black on white
245
  
257
  
246
   // Feedrate
258
   // Feedrate
247
-  u8g.setFont(u8g_font_6x10_marlin);
259
+  u8g.setFont(FONT_MENU);
248
   u8g.setPrintPos(3,49);
260
   u8g.setPrintPos(3,49);
249
   u8g.print(LCD_STR_FEEDRATE[0]);
261
   u8g.print(LCD_STR_FEEDRATE[0]);
250
   u8g.setFont(FONT_STATUSMENU);
262
   u8g.setFont(FONT_STATUSMENU);
363
 #define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
375
 #define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
364
 
376
 
365
 void lcd_implementation_drawedit(const char* pstr, char* value) {
377
 void lcd_implementation_drawedit(const char* pstr, char* value) {
366
-  u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
367
-  u8g.setFont(u8g_font_9x18);
378
+  u8g.setPrintPos(0 * DOG_CHAR_WIDTH_EDIT, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_EDIT) - (1 * DOG_CHAR_HEIGHT_EDIT) - START_ROW );
379
+  u8g.setFont(FONT_MENU_EDIT);
368
   lcd_printPGM(pstr);
380
   lcd_printPGM(pstr);
369
   u8g.print(':');
381
   u8g.print(':');
370
-  u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
382
+  u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_EDIT, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_EDIT) - (1 * DOG_CHAR_HEIGHT_EDIT) - START_ROW );
371
   u8g.print(value);
383
   u8g.print(value);
372
 }
384
 }
373
 
385
 

+ 2
- 1
Marlin/example_configurations/Hephestos/Configuration.h View File

42
 #define STRING_URL "reprap.org"
42
 #define STRING_URL "reprap.org"
43
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
43
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
44
 #define STRING_CONFIG_H_AUTHOR "(bq Hephestos)" // Who made the changes.
44
 #define STRING_CONFIG_H_AUTHOR "(bq Hephestos)" // Who made the changes.
45
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
45
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
46
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
46
 
47
 
47
 // SERIAL_PORT selects which serial port should be used for communication with the host.
48
 // SERIAL_PORT selects which serial port should be used for communication with the host.
48
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
49
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/K8200/Configuration.h View File

43
 #define STRING_URL "reprap.org"
43
 #define STRING_URL "reprap.org"
44
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
44
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
45
 #define STRING_CONFIG_H_AUTHOR "(K8200, CONSULitAS)" // Who made the changes.
45
 #define STRING_CONFIG_H_AUTHOR "(K8200, CONSULitAS)" // Who made the changes.
46
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
46
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
47
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
47
 
48
 
48
 // SERIAL_PORT selects which serial port should be used for communication with the host.
49
 // SERIAL_PORT selects which serial port should be used for communication with the host.
49
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
50
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/SCARA/Configuration.h View File

62
 #define STRING_URL "reprap.org"
62
 #define STRING_URL "reprap.org"
63
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
63
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
64
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
64
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
65
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
65
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
66
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
66
 
67
 
67
 // SERIAL_PORT selects which serial port should be used for communication with the host.
68
 // SERIAL_PORT selects which serial port should be used for communication with the host.
68
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
69
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/WITBOX/Configuration.h View File

44
 #define STRING_URL "reprap.org"
44
 #define STRING_URL "reprap.org"
45
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
45
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
46
 #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes.
46
 #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes.
47
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
47
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
48
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
48
 
49
 
49
 // SERIAL_PORT selects which serial port should be used for communication with the host.
50
 // SERIAL_PORT selects which serial port should be used for communication with the host.
50
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
51
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/delta/Configuration.h View File

37
 #define STRING_URL "reprap.org"
37
 #define STRING_URL "reprap.org"
38
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
38
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
39
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
39
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
40
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
40
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
41
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
41
 
42
 
42
 // SERIAL_PORT selects which serial port should be used for communication with the host.
43
 // SERIAL_PORT selects which serial port should be used for communication with the host.
43
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
44
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/makibox/Configuration.h View File

46
 #define STRING_URL "reprap.org"
46
 #define STRING_URL "reprap.org"
47
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
47
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
48
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
48
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
49
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
49
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
50
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
50
 
51
 
51
 // SERIAL_PORT selects which serial port should be used for communication with the host.
52
 // SERIAL_PORT selects which serial port should be used for communication with the host.
52
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
53
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 2
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

45
 #define STRING_URL "reprap.org"
45
 #define STRING_URL "reprap.org"
46
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
46
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
47
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
47
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
48
-#define STRING_SPLASH "v" STRING_VERSION " - " STRING_URL // will be shown during bootup
48
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
49
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
49
 
50
 
50
 // SERIAL_PORT selects which serial port should be used for communication with the host.
51
 // SERIAL_PORT selects which serial port should be used for communication with the host.
51
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
52
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 1
- 1
Marlin/ultralcd.cpp View File

1323
         u8g.firstPage();
1323
         u8g.firstPage();
1324
         do
1324
         do
1325
         {
1325
         {
1326
-            u8g.setFont(u8g_font_6x10_marlin);
1326
+            u8g.setFont(FONT_MENU);
1327
             u8g.setPrintPos(125,0);
1327
             u8g.setPrintPos(125,0);
1328
             if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1328
             if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1329
             u8g.drawPixel(127,63); // draw alive dot
1329
             u8g.drawPixel(127,63); // draw alive dot

Loading…
Cancel
Save