Sfoglia il codice sorgente

Merge remote-tracking branch 'upstream/Development' into independent_pid

grob6000 10 anni fa
parent
commit
0877aa0fe0

BIN
Documentation/Logo/Marlin Logo LCD High.png Vedi File


BIN
Documentation/Logo/Marlin Logo LCD Low.png Vedi File


+ 3
- 0
Marlin/Configuration.h Vedi File

@@ -24,8 +24,11 @@
24 24
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
25 25
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
26 26
 // build by the user have been successfully uploaded into firmware.
27
+#define STRING_VERSION "v1.0.2"
28
+#define STRING_URL "reprap.org"
27 29
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
28 30
 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
31
+#define STRING_SPLASH STRING_VERSION " - " STRING_URL // will be shown during bootup
29 32
 
30 33
 // SERIAL_PORT selects which serial port should be used for communication with the host.
31 34
 // This allows the connection of wireless adapters (for instance) to non-default port pins.

+ 7
- 1
Marlin/Configuration_adv.h Vedi File

@@ -297,7 +297,7 @@
297 297
 // using:
298 298
 //#define MENU_ADDAUTOSTART
299 299
 
300
-// Show a progress bar on the LCD when printing from SD?
300
+// Show a progress bar on HD44780 LCDs for SD printing
301 301
 //#define LCD_PROGRESS_BAR
302 302
 
303 303
 #ifdef LCD_PROGRESS_BAR
@@ -309,6 +309,12 @@
309 309
   #define PROGRESS_MSG_EXPIRE   0
310 310
   // Enable this to show messages for MSG_TIME then hide them
311 311
   //#define PROGRESS_MSG_ONCE
312
+  #ifdef DOGLCD
313
+    #warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
314
+  #endif
315
+  #ifdef FILAMENT_LCD_DISPLAY
316
+    #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
317
+  #endif
312 318
 #endif
313 319
 
314 320
 // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.

+ 75
- 25
Marlin/DOGMbitmaps.h Vedi File

@@ -1,28 +1,78 @@
1
-#define START_BMPWIDTH 	60	//Width in pixels - http://www.digole.com/tools/PicturetoC_Hex_converter.php
2
-#define START_BMPHEIGHT 	64	//Height in pixels
3
-#define START_BMPBYTEWIDTH 	8	//Width in bytes
4
-const unsigned char start_bmp[574] PROGMEM = { //AVR-GCC, WinAVR
5
-0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
6
-0x30,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,
7
-0x40,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,
8
-0xc0,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,
9
-0x80,0x83,0x00,0x00,0x01,0x80,0x07,0xff,
10
-0x83,0xef,0xc0,0x00,0x01,0x8c,0x03,0xff,
11
-0x87,0xff,0xe0,0x00,0x01,0x8c,0x01,0xff,
12
-0x8e,0x38,0x60,0x00,0x01,0x80,0x00,0xff,
13
-0x8c,0x18,0x67,0xe0,0xf9,0x8c,0x7e,0x7f,
14
-0x8c,0x18,0x6f,0xf1,0xfd,0x8c,0xfe,0x3f,
15
-0x8c,0x18,0x6e,0x31,0x8d,0x8c,0xc7,0x1f,
16
-0x8c,0x18,0x6c,0x39,0x8d,0x8c,0xc3,0x1f,
17
-0x8c,0x18,0x6c,0x19,0x81,0x8c,0xc3,0x1f,
18
-0x8c,0x18,0x6e,0x19,0x81,0x8c,0xc3,0x1f,
19
-0x8c,0x18,0x6f,0x9f,0x81,0xef,0xc3,0x1f,
20
-0x8c,0x18,0x67,0xdf,0x80,0xef,0xc3,0x1f,
21
-0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,
22
-0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,
23
-0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xcf,
24
-0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x8f
25
-};
1
+// BitMap for splashscreen
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 
4
+#ifdef START_BMPHIGH
5
+  #define START_BMPWIDTH      112
6
+  #define START_BMPHEIGHT      38
7
+  #define START_BMPBYTEWIDTH   14
8
+  #define START_BMPBYTES      532 // START_BMPWIDTH * START_BMPHEIGHT / 8
9
+  
10
+  const unsigned char start_bmp[START_BMPBYTES] PROGMEM = {
11
+     0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
12
+    ,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
13
+    ,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff
14
+    ,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff
15
+    ,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff
16
+    ,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff
17
+    ,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff
18
+    ,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x3f,0xff
19
+    ,0xc0,0x0f,0xc0,0xfc,0x00,0x00,0x00,0x00,0x00,0x78,0x18,0x00,0x1f,0xff
20
+    ,0xc0,0x3f,0xe1,0xff,0x00,0x00,0x00,0x00,0x00,0x78,0x3c,0x00,0x0f,0xff
21
+    ,0xc0,0x7f,0xf3,0xff,0x80,0x00,0x00,0x00,0x00,0x78,0x3c,0x00,0x07,0xff
22
+    ,0xc0,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x78,0x3c,0x00,0x03,0xff
23
+    ,0xc1,0xf8,0x7f,0x87,0xe0,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x01,0xff
24
+    ,0xc1,0xf0,0x3f,0x03,0xe0,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0xff
25
+    ,0xc1,0xe0,0x1e,0x01,0xe0,0x1f,0x00,0x03,0xe0,0x78,0x3c,0x03,0xf0,0x7f
26
+    ,0xc1,0xe0,0x1e,0x01,0xe0,0x7f,0xc0,0x0f,0xf8,0x78,0x3c,0x07,0xfc,0x3f
27
+    ,0xc1,0xe0,0x1e,0x01,0xe1,0xff,0xe0,0x1f,0xfc,0x78,0x3c,0x0f,0xfe,0x1f
28
+    ,0xc1,0xe0,0x1e,0x01,0xe3,0xff,0xf0,0x3f,0xfe,0x78,0x3c,0x1f,0xfe,0x0f
29
+    ,0xc1,0xe0,0x1e,0x01,0xe3,0xf3,0xf8,0x3f,0x3e,0x78,0x3c,0x3f,0x3f,0x07
30
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0xe0,0xfc,0x7c,0x1f,0x78,0x3c,0x3e,0x1f,0x07
31
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0xc0,0x7c,0x7c,0x0f,0x78,0x3c,0x3c,0x0f,0x03
32
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0x80,0x7c,0x78,0x0f,0x78,0x3c,0x3c,0x0f,0x03
33
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0x80,0x3c,0x78,0x00,0x78,0x3c,0x3c,0x0f,0x03
34
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0x80,0x3c,0x78,0x00,0x78,0x3c,0x3c,0x0f,0x03
35
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0x80,0x3c,0x78,0x00,0x78,0x3c,0x3c,0x0f,0x03
36
+    ,0xc1,0xe0,0x1e,0x01,0xe7,0xc0,0x3c,0x78,0x00,0x78,0x3c,0x3c,0x0f,0x03
37
+    ,0xc1,0xe0,0x1e,0x01,0xe3,0xe0,0x3c,0x78,0x00,0x7c,0x3c,0x3c,0x0f,0x03
38
+    ,0xc1,0xe0,0x1e,0x01,0xe3,0xff,0x3f,0xf8,0x00,0x7f,0xbc,0x3c,0x0f,0x03
39
+    ,0xc1,0xe0,0x1e,0x01,0xe1,0xff,0x3f,0xf8,0x00,0x3f,0xbf,0xfc,0x0f,0x03
40
+    ,0xc1,0xe0,0x1e,0x01,0xe0,0xff,0x3f,0xf8,0x00,0x1f,0xbf,0xfc,0x0f,0x03
41
+    ,0xc1,0xe0,0x1e,0x01,0xe0,0x7f,0x3f,0xf8,0x00,0x0f,0xbf,0xfc,0x0f,0x03
42
+    ,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
43
+    ,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06
44
+    ,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e
45
+    ,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c
46
+    ,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78
47
+    ,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0
48
+    ,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80 };
49
+#else
50
+  #define START_BMPWIDTH 	    56 
51
+  #define START_BMPHEIGHT 	  19
52
+  #define START_BMPBYTEWIDTH  7
53
+  #define START_BMPBYTES      133 // START_BMPWIDTH * START_BMPHEIGHT / 8
54
+
55
+  const unsigned char start_bmp[START_BMPBYTES] PROGMEM = {
56
+     0x1f,0xff,0xff,0xff,0xff,0xff,0xff
57
+    ,0x60,0x00,0x00,0x00,0x00,0x01,0xff
58
+    ,0x40,0x00,0x00,0x00,0x00,0x00,0xff
59
+    ,0x80,0x00,0x00,0x00,0x00,0x00,0x7f
60
+    ,0x83,0xcf,0x00,0x00,0x0c,0x30,0x3f
61
+    ,0x87,0xff,0x80,0x00,0x0c,0x30,0x1f
62
+    ,0x86,0x79,0x80,0x00,0x0c,0x00,0x0f
63
+    ,0x8c,0x30,0xc7,0x83,0x8c,0x30,0xe7
64
+    ,0x8c,0x30,0xcf,0xc7,0xcc,0x31,0xf3
65
+    ,0x8c,0x30,0xdc,0xec,0xec,0x33,0xb9
66
+    ,0x8c,0x30,0xd8,0x6c,0x6c,0x33,0x19
67
+    ,0x8c,0x30,0xd0,0x6c,0x0c,0x33,0x19
68
+    ,0x8c,0x30,0xd8,0x6c,0x0c,0x33,0x19
69
+    ,0x8c,0x30,0xdc,0x6c,0x0e,0x3b,0x19
70
+    ,0x8c,0x30,0xcf,0x7c,0x07,0x9f,0x19
71
+    ,0x8c,0x30,0xc7,0x7c,0x03,0x8f,0x19
72
+    ,0x40,0x00,0x00,0x00,0x00,0x00,0x02
73
+    ,0x60,0x00,0x00,0x00,0x00,0x00,0x06
74
+    ,0x1f,0xff,0xff,0xff,0xff,0xff,0xf8 };
75
+#endif
26 76
 
27 77
 // Here comes a compile-time operation to match the extruder symbols 
28 78
 // on the info screen to the set number of extruders in configuration.h

+ 192
- 221
Marlin/dogm_lcd_implementation.h Vedi File

@@ -1,19 +1,20 @@
1 1
 /**
2
- *dogm_lcd_implementation.h
2
+ * dogm_lcd_implementation.h
3 3
  *
4
- *Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin
5
- *Demonstrator: http://www.reprap.org/wiki/STB_Electronics
6
- *License: http://opensource.org/licenses/BSD-3-Clause
4
+ * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin
5
+ * Demonstrator: http://www.reprap.org/wiki/STB_Electronics
6
+ * License: http://opensource.org/licenses/BSD-3-Clause
7 7
  *
8
- *With the use of:
9
- *u8glib by Oliver Kraus
10
- *http://code.google.com/p/u8glib/
11
- *License: http://opensource.org/licenses/BSD-3-Clause
8
+ * With the use of:
9
+ * u8glib by Oliver Kraus
10
+ * http://code.google.com/p/u8glib/
11
+ * License: http://opensource.org/licenses/BSD-3-Clause
12 12
  */
13 13
 
14
+#ifndef DOGM_LCD_IMPLEMENTATION_H
15
+#define DOGM_LCD_IMPLEMENTATION_H
14 16
 
15
-#ifndef ULTRA_LCD_IMPLEMENTATION_DOGM_H
16
-#define ULTRA_LCD_IMPLEMENTATION_DOGM_H
17
+#define MARLIN_VERSION "1.0.2"
17 18
 
18 19
 /**
19 20
 * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
@@ -51,12 +52,12 @@
51 52
 */
52 53
 
53 54
 // DOGM parameters (size in pixels)
54
-#define DOG_CHAR_WIDTH			6
55
-#define DOG_CHAR_HEIGHT			12
56
-#define DOG_CHAR_WIDTH_LARGE	9
57
-#define DOG_CHAR_HEIGHT_LARGE	18
55
+#define DOG_CHAR_WIDTH         6
56
+#define DOG_CHAR_HEIGHT        12
57
+#define DOG_CHAR_WIDTH_LARGE   9
58
+#define DOG_CHAR_HEIGHT_LARGE  18
58 59
 
59
-#define START_ROW				0
60
+#define START_ROW              0
60 61
 
61 62
 /* Custom characters defined in font font_6x10_marlin.c */
62 63
 #define LCD_STR_DEGREE      "\xB0"
@@ -69,7 +70,7 @@
69 70
 #define LCD_STR_BEDTEMP     "\xFE"
70 71
 #define LCD_STR_THERMOMETER "\xFF"
71 72
 
72
-#define FONT_STATUSMENU	u8g_font_6x9
73
+#define FONT_STATUSMENU u8g_font_6x9
73 74
 
74 75
 int lcd_contrast;
75 76
 
@@ -82,78 +83,64 @@ U8GLIB_ST7920_128X64_RRD u8g(0);
82 83
 U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
83 84
 #else
84 85
 // for regular DOGM128 display with HW-SPI
85
-U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
86
+U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0
86 87
 #endif
87 88
 
88 89
 static void lcd_implementation_init()
89 90
 {
90
-#ifdef LCD_PIN_BL
91
-	pinMode(LCD_PIN_BL, OUTPUT);	// Enable LCD backlight
92
-	digitalWrite(LCD_PIN_BL, HIGH);
93
-#endif
91
+  #ifdef LCD_PIN_BL // Enable LCD backlight
92
+    pinMode(LCD_PIN_BL, OUTPUT);
93
+	  digitalWrite(LCD_PIN_BL, HIGH);
94
+  #endif
94 95
 
95
-        u8g.setContrast(lcd_contrast);	
96
-	//  Uncomment this if you have the first generation (V1.10) of STBs board
97
-	//  pinMode(17, OUTPUT);	// Enable LCD backlight
98
-	//  digitalWrite(17, HIGH);
96
+  u8g.setContrast(lcd_contrast);	
97
+	// FIXME: remove this workaround
98
+  // Uncomment this if you have the first generation (V1.10) of STBs board
99
+	// pinMode(17, OUTPUT);	// Enable LCD backlight
100
+	// digitalWrite(17, HIGH);
101
+  
102
+#ifdef LCD_SCREEN_ROT_90
103
+	u8g.setRot90();   // Rotate screen by 90°
104
+#elif defined(LCD_SCREEN_ROT_180)
105
+	u8g.setRot180();	// Rotate screen by 180°
106
+#elif defined(LCD_SCREEN_ROT_270)
107
+	u8g.setRot270();	// Rotate screen by 270°
108
+#endif
99 109
 	
110
+  // FIXME: whats the purpose of the box? Maybe clear screen?
100 111
 	u8g.firstPage();
101
-	do {
112
+  do {
102 113
 		u8g.setFont(u8g_font_6x10_marlin);
103 114
 		u8g.setColorIndex(1);
104 115
 		u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
105 116
 		u8g.setColorIndex(1);
106
-	   } while( u8g.nextPage() );
107
-
108
-#ifdef LCD_SCREEN_ROT_90
109
-	u8g.setRot90();	// Rotate screen by 90°
110
-#endif
117
+	} while(u8g.nextPage());
111 118
 
112
-#ifdef LCD_SCREEN_ROT_180
113
-	u8g.setRot180();	// Rotate screen by 180°
114
-#endif
115
-
116
-#ifdef LCD_SCREEN_ROT_270
117
-	u8g.setRot270();	// Rotate screen by 270°
118
-#endif
119
-
120
-   
119
+  // Show splashscreen
120
+  int off = (u8g.getWidth() - START_BMPWIDTH) / 2;
121
+  int txtX = (u8g.getWidth() - sizeof(STRING_SPLASH) - 1) / 2;
122
+  int txtY = u8g.getHeight() - 10;
121 123
 	u8g.firstPage();
122 124
 	do {
123
-			// RepRap init bmp
124
-			u8g.drawBitmapP(7,7,START_BMPBYTEWIDTH,START_BMPHEIGHT,start_bmp);
125
-			// Welcome message
126
-			
127
-			
128
-			
129
-			u8g.setFont(u8g_font_5x8);
130
-			u8g.drawStr(7,51,"V1.0.2 - marlin.reprap.org");
125
+    #ifdef START_BMPHIGH
126
+		  u8g.drawBitmapP(off, off, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
127
+    #else
128
+      u8g.setScale2x2();
129
+		  u8g.drawBitmapP(off, off, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
130
+      u8g.undoScale();
131
+    #endif
131 132
 			
132
-	   } while( u8g.nextPage() );
133
+    u8g.setFont(u8g_font_5x8);
134
+		u8g.drawStr(txtX, txtY, STRING_SPLASH);
135
+	} while(u8g.nextPage());
133 136
 }
134 137
 
135
-static void lcd_implementation_clear()
136
-{
137
-// NO NEED TO IMPLEMENT LIKE SO. Picture loop automatically clears the display.
138
-//
139
-// Check this article: http://arduino.cc/forum/index.php?topic=91395.25;wap2
140
-//
141
-//	u8g.firstPage();
142
-//	do {	
143
-//			u8g.setColorIndex(0);
144
-//			u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
145
-//			u8g.setColorIndex(1);
146
-//		} while( u8g.nextPage() );
147
-}
138
+static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
148 139
 
149 140
 /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
150
-static void lcd_printPGM(const char* str)
151
-{
152
-    char c;
153
-    while((c = pgm_read_byte(str++)) != '\0')
154
-    {
155
-			u8g.print(c);
156
-    }
141
+static void lcd_printPGM(const char* str) {
142
+  char c;
143
+  while ((c = pgm_read_byte(str++))) u8g.print(c);
157 144
 }
158 145
 
159 146
 static void _draw_heater_status(int x, int heater) {
@@ -176,49 +163,44 @@ static void _draw_heater_status(int x, int heater) {
176 163
   }
177 164
 }
178 165
 
179
-static void lcd_implementation_status_screen()
180
-{
166
+static void lcd_implementation_status_screen() {
181 167
 
182
- static unsigned char fan_rot = 0;
183
- 
184
- u8g.setColorIndex(1);	// black on white
168
+  static unsigned char fan_rot = 0;
185 169
  
186
- // Symbols menu graphics, animated fan
187
- u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
188
- 
189
- #ifdef SDSUPPORT
190
- //SD Card Symbol
191
- u8g.drawBox(42,42,8,7);
192
- u8g.drawBox(50,44,2,5);
193
- u8g.drawFrame(42,49,10,4);
194
- u8g.drawPixel(50,43);
195
- // Progress bar
196
- u8g.drawFrame(54,49,73,4);
170
+  u8g.setColorIndex(1); // black on white
171
+
172
+  // Symbols menu graphics, animated fan
173
+  u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
197 174
  
198
- // SD Card Progress bar and clock
199
- u8g.setFont(FONT_STATUSMENU);
175
+  #ifdef SDSUPPORT
176
+    // SD Card Symbol
177
+    u8g.drawBox(42,42,8,7);
178
+    u8g.drawBox(50,44,2,5);
179
+    u8g.drawFrame(42,49,10,4);
180
+    u8g.drawPixel(50,43);
181
+
182
+    // Progress bar frame
183
+    u8g.drawFrame(54,49,73,4);
184
+
185
+    // SD Card Progress bar and clock
186
+    u8g.setFont(FONT_STATUSMENU);
200 187
  
201
- if (IS_SD_PRINTING)
202
-   {
203
-	// Progress bar
204
-	u8g.drawBox(55,50, (unsigned int)( (71 * card.percentDone())/100) ,2);
205
-   }
188
+    if (IS_SD_PRINTING) {
189
+      // Progress bar solid part
190
+      u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2);
191
+    }
192
+
193
+    u8g.setPrintPos(80,47);
194
+    if (starttime != 0) {
195
+      uint16_t time = millis()/60000 - starttime/60000;
196
+      u8g.print(itostr2(time/60));
197
+      u8g.print(':');
198
+      u8g.print(itostr2(time%60));
199
+    }
206 200
     else {
207
-			// do nothing
208
-		 }
209
- 
210
- u8g.setPrintPos(80,47);
211
- if(starttime != 0)
212
-    {
213
-        uint16_t time = millis()/60000 - starttime/60000;
214
-
215
-		u8g.print(itostr2(time/60));
216
-		u8g.print(':');
217
-		u8g.print(itostr2(time%60));
218
-    }else{
219
-			lcd_printPGM(PSTR("--:--"));
220
-		 }
221
- #endif
201
+      lcd_printPGM(PSTR("--:--"));
202
+    }
203
+  #endif
222 204
  
223 205
   // Extruders
224 206
   _draw_heater_status(6, 0);
@@ -232,107 +214,101 @@ static void lcd_implementation_status_screen()
232 214
   // Heatbed
233 215
   _draw_heater_status(81, -1);
234 216
  
235
- // Fan
236
- u8g.setFont(FONT_STATUSMENU);
237
- u8g.setPrintPos(104,27);
238
- #if defined(FAN_PIN) && FAN_PIN > -1
239
- u8g.print(itostr3(int((fanSpeed*100)/256 + 1)));
240
- u8g.print("%");
241
- #else
242
- u8g.print("---");
243
- #endif
244
- 
245
- 
246
- // X, Y, Z-Coordinates
247
- u8g.setFont(FONT_STATUSMENU);
248
- u8g.drawBox(0,29,128,10);
249
- u8g.setColorIndex(0);	// white on black
250
- u8g.setPrintPos(2,37);
251
- u8g.print("X");
252
- u8g.drawPixel(8,33);
253
- u8g.drawPixel(8,35);
254
- u8g.setPrintPos(10,37);
255
- u8g.print(ftostr31ns(current_position[X_AXIS]));
256
- u8g.setPrintPos(43,37);
257
- lcd_printPGM(PSTR("Y"));
258
- u8g.drawPixel(49,33);
259
- u8g.drawPixel(49,35);
260
- u8g.setPrintPos(51,37);
261
- u8g.print(ftostr31ns(current_position[Y_AXIS]));
262
- u8g.setPrintPos(83,37);
263
- u8g.print("Z");
264
- u8g.drawPixel(89,33);
265
- u8g.drawPixel(89,35);
266
- u8g.setPrintPos(91,37);
267
- u8g.print(ftostr31(current_position[Z_AXIS]));
268
- u8g.setColorIndex(1);	// black on white
217
+  // Fan
218
+  u8g.setFont(FONT_STATUSMENU);
219
+  u8g.setPrintPos(104,27);
220
+  #if defined(FAN_PIN) && FAN_PIN > -1
221
+    u8g.print(itostr3(int((fanSpeed*100)/256 + 1)));
222
+    u8g.print("%");
223
+  #else
224
+    u8g.print("---");
225
+  #endif
226
+
227
+  // X, Y, Z-Coordinates
228
+  u8g.setFont(FONT_STATUSMENU);
229
+  u8g.drawBox(0,29,128,10);
230
+  u8g.setColorIndex(0); // white on black
231
+  u8g.setPrintPos(2,37);
232
+  u8g.print("X");
233
+  u8g.drawPixel(8,33);
234
+  u8g.drawPixel(8,35);
235
+  u8g.setPrintPos(10,37);
236
+  u8g.print(ftostr31ns(current_position[X_AXIS]));
237
+  u8g.setPrintPos(43,37);
238
+  lcd_printPGM(PSTR("Y"));
239
+  u8g.drawPixel(49,33);
240
+  u8g.drawPixel(49,35);
241
+  u8g.setPrintPos(51,37);
242
+  u8g.print(ftostr31ns(current_position[Y_AXIS]));
243
+  u8g.setPrintPos(83,37);
244
+  u8g.print("Z");
245
+  u8g.drawPixel(89,33);
246
+  u8g.drawPixel(89,35);
247
+  u8g.setPrintPos(91,37);
248
+  u8g.print(ftostr31(current_position[Z_AXIS]));
249
+  u8g.setColorIndex(1); // black on white
269 250
  
270
- // Feedrate
271
- u8g.setFont(u8g_font_6x10_marlin);
272
- u8g.setPrintPos(3,49);
273
- u8g.print(LCD_STR_FEEDRATE[0]);
274
- u8g.setFont(FONT_STATUSMENU);
275
- u8g.setPrintPos(12,48);
276
- u8g.print(itostr3(feedmultiply));
277
- u8g.print('%');
278
-
279
- // Status line
280
- u8g.setFont(FONT_STATUSMENU);
281
- u8g.setPrintPos(0,61);
282
- #ifndef FILAMENT_LCD_DISPLAY
283
- 	u8g.print(lcd_status_message);
284
- #else
285
-	if(message_millis+5000>millis()){  //Display both Status message line and Filament display on the last line
286
-	 u8g.print(lcd_status_message);
287
- 	}
288
- 	else
289
-	{
290
-	 lcd_printPGM(PSTR("dia:"));
291
-	 u8g.print(ftostr12ns(filament_width_meas));
292
-	 lcd_printPGM(PSTR(" factor:"));
293
-	 u8g.print(itostr3(extrudemultiply));
294
-	 u8g.print('%');
295
-	}
296
- #endif 	
251
+  // Feedrate
252
+  u8g.setFont(u8g_font_6x10_marlin);
253
+  u8g.setPrintPos(3,49);
254
+  u8g.print(LCD_STR_FEEDRATE[0]);
255
+  u8g.setFont(FONT_STATUSMENU);
256
+  u8g.setPrintPos(12,48);
257
+  u8g.print(itostr3(feedmultiply));
258
+  u8g.print('%');
297 259
 
260
+  // Status line
261
+  u8g.setFont(FONT_STATUSMENU);
262
+  u8g.setPrintPos(0,61);
263
+  #ifndef FILAMENT_LCD_DISPLAY
264
+    u8g.print(lcd_status_message);
265
+  #else
266
+    if (millis() < message_millis + 5000) {  //Display both Status message line and Filament display on the last line
267
+      u8g.print(lcd_status_message);
268
+    }
269
+    else {
270
+      lcd_printPGM(PSTR("dia:"));
271
+      u8g.print(ftostr12ns(filament_width_meas));
272
+      lcd_printPGM(PSTR(" factor:"));
273
+      u8g.print(itostr3(extrudemultiply));
274
+      u8g.print('%');
275
+    }
276
+  #endif
298 277
 }
299 278
 
300
-static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char)
301
-{
302
-    char c;
303
-    
304
-    uint8_t n = LCD_WIDTH - 1 - 2;
305
-		
306
-		if ((pre_char == '>') || (pre_char == LCD_STR_UPLEVEL[0] ))
307
-		   {
308
-			u8g.setColorIndex(1);		// black on white
309
-			u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
310
-			u8g.setColorIndex(0);		// following text must be white on black
311
-		   } else u8g.setColorIndex(1); // unmarked text is black on white
312
-		
313
-		u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
314
-		u8g.print(pre_char == '>' ? ' ' : pre_char);	// Row selector is obsolete
315
-
316
-
317
-    while( (c = pgm_read_byte(pstr)) != '\0' )
318
-    {
319
-		u8g.print(c);
320
-        pstr++;
321
-        n--;
322
-    }
323
-    while(n--){
324
-					u8g.print(' ');
325
-		}
326
-	   
327
-		u8g.print(post_char);
328
-		u8g.print(' ');
329
-		u8g.setColorIndex(1);		// restore settings to black on white
279
+static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
280
+  char c;
281
+  
282
+  uint8_t n = LCD_WIDTH - 1 - 2;
283
+  
284
+  if ((pre_char == '>') || (pre_char == LCD_STR_UPLEVEL[0] )) {
285
+    u8g.setColorIndex(1);  // black on white
286
+    u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
287
+    u8g.setColorIndex(0);  // following text must be white on black
288
+  }
289
+  else {
290
+    u8g.setColorIndex(1); // unmarked text is black on white
291
+  }
292
+  
293
+  u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
294
+  u8g.print(pre_char == '>' ? ' ' : pre_char);  // Row selector is obsolete
295
+
296
+  while((c = pgm_read_byte(pstr))) {
297
+    u8g.print(c);
298
+    pstr++;
299
+    n--;
300
+  }
301
+  while(n--) u8g.print(' ');
302
+  
303
+  u8g.print(post_char);
304
+  u8g.print(' ');
305
+  u8g.setColorIndex(1);  // restore settings to black on white
330 306
 }
331 307
 
332 308
 static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
333 309
   char c;
334 310
   uint8_t n = LCD_WIDTH - 1 - 2 - (pgm ? strlen_P(data) : strlen(data));
335
-		
311
+
336 312
   u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
337 313
   u8g.print(pre_char);
338 314
 
@@ -391,14 +367,13 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p
391 367
 #define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
392 368
 #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))
393 369
 
394
-void lcd_implementation_drawedit(const char* pstr, char* value)
395
-{
396
-		u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
397
-		u8g.setFont(u8g_font_9x18);
398
-		lcd_printPGM(pstr);
399
-		u8g.print(':');
400
-		u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
401
-		u8g.print(value);
370
+void lcd_implementation_drawedit(const char* pstr, char* value) {
371
+  u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
372
+  u8g.setFont(u8g_font_9x18);
373
+  lcd_printPGM(pstr);
374
+  u8g.print(':');
375
+  u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
376
+  u8g.print(value);
402 377
 }
403 378
 
404 379
 static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) {
@@ -417,7 +392,7 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch
417 392
   }
418 393
 
419 394
   u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
420
-  u8g.print(' ');	// Indent by 1 char
395
+  u8g.print(' '); // Indent by 1 char
421 396
 
422 397
   if (isDir) u8g.print(LCD_STR_FOLDER[0]);
423 398
 
@@ -445,20 +420,16 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch
445 420
 #define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
446 421
 #define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
447 422
 
448
-static void lcd_implementation_quick_feedback()
449
-{
450
-
451
-#if BEEPER > -1
423
+static void lcd_implementation_quick_feedback() {
424
+  #if BEEPER > -1
452 425
     SET_OUTPUT(BEEPER);
453
-    for(int8_t i=0;i<10;i++)
454
-    {
455
-		WRITE(BEEPER,HIGH);
456
-		delay(3);
457
-		WRITE(BEEPER,LOW);
458
-		delay(3);
426
+    for(int8_t i=0; i<10; i++) {
427
+      WRITE(BEEPER,HIGH);
428
+      delay(3);
429
+      WRITE(BEEPER,LOW);
430
+      delay(3);
459 431
     }
460
-#endif
432
+  #endif
461 433
 }
462
-#endif//ULTRA_LCD_IMPLEMENTATION_DOGM_H
463
-
464 434
 
435
+#endif //__DOGM_LCD_IMPLEMENTATION_H

+ 8
- 7
Marlin/ultralcd.cpp Vedi File

@@ -196,7 +196,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool
196 196
     if (feedback) lcd_quick_feedback();
197 197
 
198 198
     // For LCD_PROGRESS_BAR re-initialize the custom characters
199
-    #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
199
+    #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
200 200
       lcd_set_custom_characters(menu == lcd_status_screen);
201 201
     #endif
202 202
   }
@@ -205,7 +205,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool
205 205
 /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
206 206
 static void lcd_status_screen()
207 207
 {
208
-  #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
208
+  #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
209 209
     uint16_t mil = millis();
210 210
     #ifndef PROGRESS_MSG_ONCE
211 211
       if (mil > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
@@ -237,11 +237,12 @@ static void lcd_status_screen()
237 237
         lcd_status_update_delay--;
238 238
     else
239 239
         lcdDrawUpdate = 1;
240
-    if (lcdDrawUpdate)
241
-    {
240
+
241
+    if (lcdDrawUpdate) {
242 242
         lcd_implementation_status_screen();
243 243
         lcd_status_update_delay = 10;   /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
244 244
     }
245
+
245 246
 #ifdef ULTIPANEL
246 247
 
247 248
     bool current_click = LCD_CLICKED;
@@ -266,7 +267,7 @@ static void lcd_status_screen()
266 267
     {
267 268
         lcd_goto_menu(lcd_main_menu);
268 269
         lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
269
-          #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
270
+          #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
270 271
             currentMenu == lcd_status_screen
271 272
           #endif
272 273
         );
@@ -1216,7 +1217,7 @@ void lcd_update()
1216 1217
         lcdDrawUpdate = 2;
1217 1218
         lcd_oldcardstatus = IS_SD_INSERTED;
1218 1219
         lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
1219
-          #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
1220
+          #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
1220 1221
             currentMenu == lcd_status_screen
1221 1222
           #endif
1222 1223
         );
@@ -1319,7 +1320,7 @@ void lcd_finishstatus() {
1319 1320
     }
1320 1321
   }
1321 1322
   lcd_status_message[LCD_WIDTH] = '\0';
1322
-  #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
1323
+  #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
1323 1324
     #if PROGRESS_MSG_EXPIRE > 0
1324 1325
       messageTick =
1325 1326
     #endif

+ 1
- 1
Marlin/ultralcd.h Vedi File

@@ -49,7 +49,7 @@
49 49
   #ifdef FILAMENT_LCD_DISPLAY
50 50
         extern unsigned long message_millis;
51 51
   #endif
52
-    
52
+
53 53
   void lcd_buzz(long duration,uint16_t freq);
54 54
   bool lcd_clicked();
55 55
 

Loading…
Annulla
Salva