|
@@ -221,11 +221,57 @@ static void createChar_P(const char c, const byte * const ptr) {
|
221
|
221
|
lcd.createChar(c, temp);
|
222
|
222
|
}
|
223
|
223
|
|
|
224
|
+#define CHARSET_MENU 0
|
|
225
|
+#define CHARSET_INFO 1
|
|
226
|
+#define CHARSET_BOOT 2
|
|
227
|
+
|
224
|
228
|
static void lcd_set_custom_characters(
|
225
|
|
- #if ENABLED(LCD_PROGRESS_BAR)
|
226
|
|
- const bool info_screen_charset = true
|
|
229
|
+ #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
|
|
230
|
+ const uint8_t screen_charset=CHARSET_INFO
|
227
|
231
|
#endif
|
228
|
232
|
) {
|
|
233
|
+ // CHARSET_BOOT
|
|
234
|
+ #if ENABLED(SHOW_BOOTSCREEN)
|
|
235
|
+ const static PROGMEM byte corner[4][8] = { {
|
|
236
|
+ B00000,
|
|
237
|
+ B00000,
|
|
238
|
+ B00000,
|
|
239
|
+ B00000,
|
|
240
|
+ B00001,
|
|
241
|
+ B00010,
|
|
242
|
+ B00100,
|
|
243
|
+ B00100
|
|
244
|
+ }, {
|
|
245
|
+ B00000,
|
|
246
|
+ B00000,
|
|
247
|
+ B00000,
|
|
248
|
+ B11100,
|
|
249
|
+ B11100,
|
|
250
|
+ B01100,
|
|
251
|
+ B00100,
|
|
252
|
+ B00100
|
|
253
|
+ }, {
|
|
254
|
+ B00100,
|
|
255
|
+ B00010,
|
|
256
|
+ B00001,
|
|
257
|
+ B00000,
|
|
258
|
+ B00000,
|
|
259
|
+ B00000,
|
|
260
|
+ B00000,
|
|
261
|
+ B00000
|
|
262
|
+ }, {
|
|
263
|
+ B00100,
|
|
264
|
+ B01000,
|
|
265
|
+ B10000,
|
|
266
|
+ B00000,
|
|
267
|
+ B00000,
|
|
268
|
+ B00000,
|
|
269
|
+ B00000,
|
|
270
|
+ B00000
|
|
271
|
+ } };
|
|
272
|
+ #endif // SHOW_BOOTSCREEN
|
|
273
|
+
|
|
274
|
+ // CHARSET_INFO
|
229
|
275
|
const static PROGMEM byte bedTemp[8] = {
|
230
|
276
|
B00000,
|
231
|
277
|
B11111,
|
|
@@ -293,6 +339,8 @@ static void lcd_set_custom_characters(
|
293
|
339
|
};
|
294
|
340
|
|
295
|
341
|
#if ENABLED(SDSUPPORT)
|
|
342
|
+
|
|
343
|
+ // CHARSET_MENU
|
296
|
344
|
const static PROGMEM byte refresh[8] = {
|
297
|
345
|
B00000,
|
298
|
346
|
B00110,
|
|
@@ -315,6 +363,8 @@ static void lcd_set_custom_characters(
|
315
|
363
|
};
|
316
|
364
|
|
317
|
365
|
#if ENABLED(LCD_PROGRESS_BAR)
|
|
366
|
+
|
|
367
|
+ // CHARSET_INFO
|
318
|
368
|
const static PROGMEM byte progress[3][8] = { {
|
319
|
369
|
B00000,
|
320
|
370
|
B10000,
|
|
@@ -343,43 +393,61 @@ static void lcd_set_custom_characters(
|
343
|
393
|
B10101,
|
344
|
394
|
B00000
|
345
|
395
|
} };
|
346
|
|
- #endif
|
347
|
|
- #endif
|
348
|
396
|
|
349
|
|
- createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
|
350
|
|
- createChar_P(LCD_DEGREE_CHAR, degree);
|
351
|
|
- createChar_P(LCD_STR_THERMOMETER[0], thermometer);
|
352
|
|
- createChar_P(LCD_FEEDRATE_CHAR, feedrate);
|
353
|
|
- createChar_P(LCD_CLOCK_CHAR, clock);
|
|
397
|
+ #endif // LCD_PROGRESS_BAR
|
354
|
398
|
|
355
|
|
- #if ENABLED(SDSUPPORT)
|
356
|
|
- #if ENABLED(LCD_PROGRESS_BAR)
|
357
|
|
- static bool char_mode = false;
|
358
|
|
- if (info_screen_charset != char_mode) {
|
359
|
|
- char_mode = info_screen_charset;
|
360
|
|
- if (info_screen_charset) { // Progress bar characters for info screen
|
361
|
|
- for (int16_t i = 3; i--;) createChar_P(LCD_STR_PROGRESS[i], progress[i]);
|
362
|
|
- }
|
363
|
|
- else { // Custom characters for submenus
|
364
|
|
- createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
365
|
|
- createChar_P(LCD_STR_REFRESH[0], refresh);
|
366
|
|
- createChar_P(LCD_STR_FOLDER[0], folder);
|
367
|
|
- }
|
368
|
|
- }
|
369
|
|
- #else
|
370
|
|
- createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
371
|
|
- createChar_P(LCD_STR_REFRESH[0], refresh);
|
372
|
|
- createChar_P(LCD_STR_FOLDER[0], folder);
|
373
|
|
- #endif
|
|
399
|
+ #endif // SDSUPPORT
|
374
|
400
|
|
|
401
|
+ #if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR)
|
|
402
|
+ static uint8_t char_mode = 0;
|
|
403
|
+ #define CHAR_COND (screen_charset != char_mode)
|
375
|
404
|
#else
|
376
|
|
- createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
405
|
+ #define CHAR_COND true
|
377
|
406
|
#endif
|
|
407
|
+
|
|
408
|
+ if (CHAR_COND) {
|
|
409
|
+ #if ENABLED(SHOW_BOOTSCREEN) || ENABLED(LCD_PROGRESS_BAR)
|
|
410
|
+ char_mode = screen_charset;
|
|
411
|
+ #if ENABLED(SHOW_BOOTSCREEN)
|
|
412
|
+ // Set boot screen corner characters
|
|
413
|
+ if (screen_charset == CHARSET_BOOT) {
|
|
414
|
+ for (uint8_t i = 4; i--;)
|
|
415
|
+ createChar_P(i, corner[i]);
|
|
416
|
+ }
|
|
417
|
+ else
|
|
418
|
+ #endif
|
|
419
|
+ #endif
|
|
420
|
+ { // Info Screen uses 5 special characters
|
|
421
|
+ createChar_P(LCD_BEDTEMP_CHAR, bedTemp);
|
|
422
|
+ createChar_P(LCD_DEGREE_CHAR, degree);
|
|
423
|
+ createChar_P(LCD_STR_THERMOMETER[0], thermometer);
|
|
424
|
+ createChar_P(LCD_FEEDRATE_CHAR, feedrate);
|
|
425
|
+ createChar_P(LCD_CLOCK_CHAR, clock);
|
|
426
|
+
|
|
427
|
+ #if ENABLED(SDSUPPORT)
|
|
428
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
|
429
|
+ if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen
|
|
430
|
+ for (int16_t i = 3; i--;)
|
|
431
|
+ createChar_P(LCD_STR_PROGRESS[i], progress[i]);
|
|
432
|
+ }
|
|
433
|
+ else
|
|
434
|
+ #endif
|
|
435
|
+ { // SD Card sub-menu special characters
|
|
436
|
+ createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
437
|
+ createChar_P(LCD_STR_REFRESH[0], refresh);
|
|
438
|
+ createChar_P(LCD_STR_FOLDER[0], folder);
|
|
439
|
+ }
|
|
440
|
+ #else
|
|
441
|
+ // With no SD support, only need the uplevel character
|
|
442
|
+ createChar_P(LCD_UPLEVEL_CHAR, uplevel);
|
|
443
|
+ #endif
|
|
444
|
+ }
|
|
445
|
+ }
|
378
|
446
|
}
|
379
|
447
|
|
380
|
448
|
static void lcd_implementation_init(
|
381
|
449
|
#if ENABLED(LCD_PROGRESS_BAR)
|
382
|
|
- const bool info_screen_charset = true
|
|
450
|
+ const uint8_t screen_charset=CHARSET_INFO
|
383
|
451
|
#endif
|
384
|
452
|
) {
|
385
|
453
|
|
|
@@ -409,7 +477,7 @@ static void lcd_implementation_init(
|
409
|
477
|
|
410
|
478
|
lcd_set_custom_characters(
|
411
|
479
|
#if ENABLED(LCD_PROGRESS_BAR)
|
412
|
|
- info_screen_charset
|
|
480
|
+ screen_charset
|
413
|
481
|
#endif
|
414
|
482
|
);
|
415
|
483
|
|