|
@@ -193,12 +193,18 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
|
193
|
193
|
static void lcd_implementation_update_indicators();
|
194
|
194
|
#endif
|
195
|
195
|
|
196
|
|
-static void lcd_set_custom_characters(
|
197
|
|
- #if ENABLED(LCD_PROGRESS_BAR)
|
198
|
|
- const bool info_screen_charset = true
|
199
|
|
- #endif
|
200
|
|
-) {
|
201
|
|
- static byte bedTemp[8] = {
|
|
196
|
+
|
|
197
|
+static void createChar_P(char c, PROGMEM byte *ptr) {
|
|
198
|
+ byte temp[8];
|
|
199
|
+ int8_t i;
|
|
200
|
+
|
|
201
|
+ for(i=0; i<8; i++) {
|
|
202
|
+ temp[i] = pgm_read_byte(&ptr[i]);
|
|
203
|
+ }
|
|
204
|
+ lcd.createChar(c, temp);
|
|
205
|
+}
|
|
206
|
+
|
|
207
|
+const static PROGMEM byte bedTemp[8] = {
|
202
|
208
|
B00000,
|
203
|
209
|
B11111,
|
204
|
210
|
B10101,
|
|
@@ -207,8 +213,9 @@ static void lcd_set_custom_characters(
|
207
|
213
|
B11111,
|
208
|
214
|
B00000,
|
209
|
215
|
B00000
|
210
|
|
- }; //thanks Sonny Mounicou
|
211
|
|
- static byte degree[8] = {
|
|
216
|
+};
|
|
217
|
+
|
|
218
|
+const static PROGMEM byte degree[8] = {
|
212
|
219
|
B01100,
|
213
|
220
|
B10010,
|
214
|
221
|
B10010,
|
|
@@ -218,7 +225,8 @@ static void lcd_set_custom_characters(
|
218
|
225
|
B00000,
|
219
|
226
|
B00000
|
220
|
227
|
};
|
221
|
|
- static byte thermometer[8] = {
|
|
228
|
+
|
|
229
|
+const static PROGMEM byte thermometer[8] = {
|
222
|
230
|
B00100,
|
223
|
231
|
B01010,
|
224
|
232
|
B01010,
|
|
@@ -228,7 +236,8 @@ static void lcd_set_custom_characters(
|
228
|
236
|
B10001,
|
229
|
237
|
B01110
|
230
|
238
|
};
|
231
|
|
- static byte uplevel[8] = {
|
|
239
|
+
|
|
240
|
+const static PROGMEM byte uplevel[8] = {
|
232
|
241
|
B00100,
|
233
|
242
|
B01110,
|
234
|
243
|
B11111,
|
|
@@ -237,8 +246,9 @@ static void lcd_set_custom_characters(
|
237
|
246
|
B00000,
|
238
|
247
|
B00000,
|
239
|
248
|
B00000
|
240
|
|
- }; //thanks joris
|
241
|
|
- static byte feedrate[8] = {
|
|
249
|
+};
|
|
250
|
+
|
|
251
|
+const static PROGMEM byte feedrate[8] = {
|
242
|
252
|
B11100,
|
243
|
253
|
B10000,
|
244
|
254
|
B11000,
|
|
@@ -247,8 +257,9 @@ static void lcd_set_custom_characters(
|
247
|
257
|
B00110,
|
248
|
258
|
B00101,
|
249
|
259
|
B00000
|
250
|
|
- }; //thanks Sonny Mounicou
|
251
|
|
- static byte clock[8] = {
|
|
260
|
+};
|
|
261
|
+
|
|
262
|
+const static PROGMEM byte clock[8] = {
|
252
|
263
|
B00000,
|
253
|
264
|
B01110,
|
254
|
265
|
B10011,
|
|
@@ -257,16 +268,10 @@ static void lcd_set_custom_characters(
|
257
|
268
|
B01110,
|
258
|
269
|
B00000,
|
259
|
270
|
B00000
|
260
|
|
- }; //thanks Sonny Mounicou
|
|
271
|
+};
|
261
|
272
|
|
262
|
|
- lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
263
|
|
- lcd.createChar(LCD_STR_DEGREE[0], degree);
|
264
|
|
- lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|
265
|
|
- lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
|
266
|
|
- lcd.createChar(LCD_STR_CLOCK[0], clock);
|
267
|
|
-
|
268
|
|
- #if ENABLED(SDSUPPORT)
|
269
|
|
- static byte refresh[8] = {
|
|
273
|
+#if ENABLED(SDSUPPORT)
|
|
274
|
+ const static PROGMEM byte refresh[8] = {
|
270
|
275
|
B00000,
|
271
|
276
|
B00110,
|
272
|
277
|
B11001,
|
|
@@ -275,8 +280,8 @@ static void lcd_set_custom_characters(
|
275
|
280
|
B10011,
|
276
|
281
|
B01100,
|
277
|
282
|
B00000,
|
278
|
|
- }; //thanks joris
|
279
|
|
- static byte folder[8] = {
|
|
283
|
+ };
|
|
284
|
+ const static PROGMEM byte folder[8] = {
|
280
|
285
|
B00000,
|
281
|
286
|
B11100,
|
282
|
287
|
B11111,
|
|
@@ -285,10 +290,10 @@ static void lcd_set_custom_characters(
|
285
|
290
|
B11111,
|
286
|
291
|
B00000,
|
287
|
292
|
B00000
|
288
|
|
- }; //thanks joris
|
|
293
|
+ };
|
289
|
294
|
|
290
|
|
- #if ENABLED(LCD_PROGRESS_BAR)
|
291
|
|
- static byte progress[3][8] = { {
|
|
295
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
|
296
|
+ const static PROGMEM byte progress[3][8] = { {
|
292
|
297
|
B00000,
|
293
|
298
|
B10000,
|
294
|
299
|
B10000,
|
|
@@ -316,26 +321,43 @@ static void lcd_set_custom_characters(
|
316
|
321
|
B10101,
|
317
|
322
|
B00000
|
318
|
323
|
} };
|
|
324
|
+ #endif
|
|
325
|
+#endif
|
|
326
|
+
|
|
327
|
+static void lcd_set_custom_characters(
|
|
328
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
|
329
|
+ const bool info_screen_charset = true
|
|
330
|
+ #endif
|
|
331
|
+) {
|
|
332
|
+
|
|
333
|
+ createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
|
|
334
|
+ createChar_P(LCD_DEGREE_CHAR, degree);
|
|
335
|
+ createChar_P(LCD_STR_THERMOMETER[0], thermometer);
|
|
336
|
+ createChar_P(LCD_FEEDRATE_CHAR, feedrate);
|
|
337
|
+ createChar_P(LCD_CLOCK_CHAR, clock);
|
|
338
|
+
|
|
339
|
+ #if ENABLED(SDSUPPORT)
|
|
340
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
319
|
341
|
static bool char_mode = false;
|
320
|
342
|
if (info_screen_charset != char_mode) {
|
321
|
343
|
char_mode = info_screen_charset;
|
322
|
344
|
if (info_screen_charset) { // Progress bar characters for info screen
|
323
|
|
- for (int i = 3; i--;) lcd.createChar(LCD_STR_PROGRESS[i], progress[i]);
|
|
345
|
+ for (int i = 3; i--;) createChar_P(LCD_STR_PROGRESS[i], progress[i]);
|
324
|
346
|
}
|
325
|
347
|
else { // Custom characters for submenus
|
326
|
|
- lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
327
|
|
- lcd.createChar(LCD_STR_REFRESH[0], refresh);
|
328
|
|
- lcd.createChar(LCD_STR_FOLDER[0], folder);
|
|
348
|
+ createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
349
|
+ createChar_P(LCD_REFRESH_CHAR, refresh);
|
|
350
|
+ createChar_P(LCD_STR_FOLDER[0], folder);
|
329
|
351
|
}
|
330
|
352
|
}
|
331
|
353
|
#else
|
332
|
|
- lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
333
|
|
- lcd.createChar(LCD_STR_REFRESH[0], refresh);
|
334
|
|
- lcd.createChar(LCD_STR_FOLDER[0], folder);
|
|
354
|
+ createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
355
|
+ createChar_P(LCD_REFRESH_CHAR, refresh);
|
|
356
|
+ createChar_P(LCD_STR_FOLDER[0], folder);
|
335
|
357
|
#endif
|
336
|
358
|
|
337
|
359
|
#else
|
338
|
|
- lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
|
360
|
+ createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
339
|
361
|
#endif
|
340
|
362
|
}
|
341
|
363
|
|
|
@@ -607,7 +629,8 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co
|
607
|
629
|
lcd.print(itostr3left(t2 + 0.5));
|
608
|
630
|
|
609
|
631
|
if (prefix >= 0) {
|
610
|
|
- lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
|
|
632
|
+ lcd.print((char)LCD_DEGREE_CHAR);
|
|
633
|
+ lcd.print(' ');
|
611
|
634
|
if (t2 < 10) lcd.print(' ');
|
612
|
635
|
}
|
613
|
636
|
}
|
|
@@ -677,10 +700,10 @@ static void lcd_implementation_status_screen() {
|
677
|
700
|
|
678
|
701
|
lcd.setCursor(8, 0);
|
679
|
702
|
#if HOTENDS > 1
|
680
|
|
- lcd.print(LCD_STR_THERMOMETER[0]);
|
|
703
|
+ lcd.print((CHAR)LCD_STR_THERMOMETER[0]);
|
681
|
704
|
_draw_heater_status(1, -1, blink);
|
682
|
705
|
#else
|
683
|
|
- lcd.print(LCD_STR_BEDTEMP[0]);
|
|
706
|
+ lcd.print((CHAR)LCD_BEDTEMP_CHAR);
|
684
|
707
|
_draw_heater_status(-1, -1, blink);
|
685
|
708
|
#endif
|
686
|
709
|
|
|
@@ -701,7 +724,7 @@ static void lcd_implementation_status_screen() {
|
701
|
724
|
#if HOTENDS > 1
|
702
|
725
|
_draw_heater_status(1, LCD_STR_THERMOMETER[0], blink);
|
703
|
726
|
#else
|
704
|
|
- _draw_heater_status(-1, LCD_STR_BEDTEMP[0], blink);
|
|
727
|
+ _draw_heater_status(-1, LCD_BEDTEMP_CHAR, blink);
|
705
|
728
|
#endif
|
706
|
729
|
|
707
|
730
|
#endif // HOTENDS > 1 || TEMP_SENSOR_BED != 0
|
|
@@ -735,7 +758,7 @@ static void lcd_implementation_status_screen() {
|
735
|
758
|
// If we both have a 2nd extruder and a heated bed,
|
736
|
759
|
// show the heated bed temp on the left,
|
737
|
760
|
// since the first line is filled with extruder temps
|
738
|
|
- _draw_heater_status(-1, LCD_STR_BEDTEMP[0], blink);
|
|
761
|
+ _draw_heater_status(-1, LCD_BEDTEMP_CHAR, blink);
|
739
|
762
|
|
740
|
763
|
#else
|
741
|
764
|
// Before homing the axis letters are blinking 'X' <-> '?'.
|
|
@@ -767,7 +790,7 @@ static void lcd_implementation_status_screen() {
|
767
|
790
|
#if LCD_HEIGHT > 3
|
768
|
791
|
|
769
|
792
|
lcd.setCursor(0, 2);
|
770
|
|
- lcd.print(LCD_STR_FEEDRATE[0]);
|
|
793
|
+ lcd.print((char)LCD_FEEDRATE_CHAR);
|
771
|
794
|
lcd.print(itostr3(feedrate_percentage));
|
772
|
795
|
lcd.print('%');
|
773
|
796
|
|
|
@@ -788,7 +811,7 @@ static void lcd_implementation_status_screen() {
|
788
|
811
|
uint8_t len = elapsed.toDigital(buffer);
|
789
|
812
|
|
790
|
813
|
lcd.setCursor(LCD_WIDTH - len - 1, 2);
|
791
|
|
- lcd.print(LCD_STR_CLOCK[0]);
|
|
814
|
+ lcd.print((char)LCD_CLOCK_CHAR);
|
792
|
815
|
lcd_print(buffer);
|
793
|
816
|
|
794
|
817
|
#endif // LCD_HEIGHT > 3
|
|
@@ -980,7 +1003,7 @@ static void lcd_implementation_status_screen() {
|
980
|
1003
|
|
981
|
1004
|
#endif // SDSUPPORT
|
982
|
1005
|
|
983
|
|
- #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
|
|
1006
|
+ #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR,LCD_UPLEVEL_CHAR)
|
984
|
1007
|
#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
|
985
|
1008
|
#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|
986
|
1009
|
#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
|