浏览代码

Merge pull request #5288 from thinkyhead/rc_selective_rendering

Optimize graphical display with selective rendering
Scott Lahteine 8 年前
父节点
当前提交
668e737893
共有 25 个文件被更改,包括 568 次插入346 次删除
  1. 9
    5
      Marlin/Configuration_adv.h
  2. 9
    5
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  3. 9
    5
      Marlin/example_configurations/Felix/Configuration_adv.h
  4. 9
    5
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  5. 9
    5
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  6. 9
    5
      Marlin/example_configurations/K8200/Configuration_adv.h
  7. 9
    5
      Marlin/example_configurations/K8400/Configuration_adv.h
  8. 9
    5
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  9. 9
    5
      Marlin/example_configurations/SCARA/Configuration_adv.h
  10. 9
    5
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  11. 9
    5
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  12. 9
    5
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  13. 9
    5
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  14. 9
    5
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  15. 9
    5
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  16. 9
    5
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  17. 9
    5
      Marlin/example_configurations/makibox/Configuration_adv.h
  18. 9
    5
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  19. 7
    1
      Marlin/language.h
  20. 5
    5
      Marlin/ultralcd.cpp
  21. 3
    3
      Marlin/ultralcd.h
  22. 288
    150
      Marlin/ultralcd_impl_DOGM.h
  23. 16
    16
      Marlin/ultralcd_impl_HD44780.h
  24. 19
    13
      Marlin/ultralcd_st7920_u8glib_rrd.h
  25. 68
    68
      Marlin/utf_mapper.h

+ 9
- 5
Marlin/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/Cartesio/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/Felix/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/Hephestos/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/Hephestos_2/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   #define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/K8200/Configuration_adv.h 查看文件

@@ -473,15 +473,19 @@
473 473
 
474 474
 #endif // SDSUPPORT
475 475
 
476
-// for dogm lcd displays you can choose some additional fonts:
476
+// Some additional options are available for graphical displays:
477 477
 #if ENABLED(DOGLCD)
478
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
479
-  // we don't have a big font for Cyrillic, Kana
478
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
479
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
480 480
   //#define USE_BIG_EDIT_FONT
481 481
 
482
-  // If you have spare 2300Byte of progmem and want to use a
483
-  // smaller font on the Info-screen uncomment the next line.
482
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
483
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
484 484
   //#define USE_SMALL_INFOFONT
485
+
486
+  // Enable this option and reduce the value to optimize screen updates.
487
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
488
+  //#define DOGM_SPI_DELAY_US 5
485 489
 #endif // DOGLCD
486 490
 
487 491
 // @section safety

+ 9
- 5
Marlin/example_configurations/K8400/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/RigidBot/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/SCARA/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/TAZ4/Configuration_adv.h 查看文件

@@ -468,15 +468,19 @@
468 468
 
469 469
 #endif // SDSUPPORT
470 470
 
471
-// for dogm lcd displays you can choose some additional fonts:
471
+// Some additional options are available for graphical displays:
472 472
 #if ENABLED(DOGLCD)
473
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
474
-  // we don't have a big font for Cyrillic, Kana
473
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
474
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
475 475
   //#define USE_BIG_EDIT_FONT
476 476
 
477
-  // If you have spare 2300Byte of progmem and want to use a
478
-  // smaller font on the Info-screen uncomment the next line.
477
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
478
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
479 479
   //#define USE_SMALL_INFOFONT
480
+
481
+  // Enable this option and reduce the value to optimize screen updates.
482
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
483
+  //#define DOGM_SPI_DELAY_US 5
480 484
 #endif // DOGLCD
481 485
 
482 486
 // @section safety

+ 9
- 5
Marlin/example_configurations/WITBOX/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h 查看文件

@@ -462,15 +462,19 @@
462 462
 
463 463
 #endif // SDSUPPORT
464 464
 
465
-// for dogm lcd displays you can choose some additional fonts:
465
+// Some additional options are available for graphical displays:
466 466
 #if ENABLED(DOGLCD)
467
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
468
-  // we don't have a big font for Cyrillic, Kana
467
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
468
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
469 469
   //#define USE_BIG_EDIT_FONT
470 470
 
471
-  // If you have spare 2300Byte of progmem and want to use a
472
-  // smaller font on the Info-screen uncomment the next line.
471
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
472
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
473 473
   //#define USE_SMALL_INFOFONT
474
+
475
+  // Enable this option and reduce the value to optimize screen updates.
476
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
477
+  //#define DOGM_SPI_DELAY_US 5
474 478
 #endif // DOGLCD
475 479
 
476 480
 // @section safety

+ 9
- 5
Marlin/example_configurations/delta/generic/Configuration_adv.h 查看文件

@@ -462,15 +462,19 @@
462 462
 
463 463
 #endif // SDSUPPORT
464 464
 
465
-// for dogm lcd displays you can choose some additional fonts:
465
+// Some additional options are available for graphical displays:
466 466
 #if ENABLED(DOGLCD)
467
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
468
-  // we don't have a big font for Cyrillic, Kana
467
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
468
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
469 469
   //#define USE_BIG_EDIT_FONT
470 470
 
471
-  // If you have spare 2300Byte of progmem and want to use a
472
-  // smaller font on the Info-screen uncomment the next line.
471
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
472
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
473 473
   //#define USE_SMALL_INFOFONT
474
+
475
+  // Enable this option and reduce the value to optimize screen updates.
476
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
477
+  //#define DOGM_SPI_DELAY_US 5
474 478
 #endif // DOGLCD
475 479
 
476 480
 // @section safety

+ 9
- 5
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h 查看文件

@@ -462,15 +462,19 @@
462 462
 
463 463
 #endif // SDSUPPORT
464 464
 
465
-// for dogm lcd displays you can choose some additional fonts:
465
+// Some additional options are available for graphical displays:
466 466
 #if ENABLED(DOGLCD)
467
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
468
-  // we don't have a big font for Cyrillic, Kana
467
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
468
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
469 469
   //#define USE_BIG_EDIT_FONT
470 470
 
471
-  // If you have spare 2300Byte of progmem and want to use a
472
-  // smaller font on the Info-screen uncomment the next line.
471
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
472
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
473 473
   //#define USE_SMALL_INFOFONT
474
+
475
+  // Enable this option and reduce the value to optimize screen updates.
476
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
477
+  //#define DOGM_SPI_DELAY_US 5
474 478
 #endif // DOGLCD
475 479
 
476 480
 // @section safety

+ 9
- 5
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h 查看文件

@@ -467,15 +467,19 @@
467 467
 
468 468
 #endif // SDSUPPORT
469 469
 
470
-// for dogm lcd displays you can choose some additional fonts:
470
+// Some additional options are available for graphical displays:
471 471
 #if ENABLED(DOGLCD)
472
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
473
-  // we don't have a big font for Cyrillic, Kana
472
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
473
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
474 474
   //#define USE_BIG_EDIT_FONT
475 475
 
476
-  // If you have spare 2300Byte of progmem and want to use a
477
-  // smaller font on the Info-screen uncomment the next line.
476
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
477
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
478 478
   //#define USE_SMALL_INFOFONT
479
+
480
+  // Enable this option and reduce the value to optimize screen updates.
481
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
482
+  //#define DOGM_SPI_DELAY_US 5
479 483
 #endif // DOGLCD
480 484
 
481 485
 // @section safety

+ 9
- 5
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h 查看文件

@@ -462,15 +462,19 @@
462 462
 
463 463
 #endif // SDSUPPORT
464 464
 
465
-// for dogm lcd displays you can choose some additional fonts:
465
+// Some additional options are available for graphical displays:
466 466
 #if ENABLED(DOGLCD)
467
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
468
-  // we don't have a big font for Cyrillic, Kana
467
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
468
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
469 469
   //#define USE_BIG_EDIT_FONT
470 470
 
471
-  // If you have spare 2300Byte of progmem and want to use a
472
-  // smaller font on the Info-screen uncomment the next line.
471
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
472
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
473 473
   //#define USE_SMALL_INFOFONT
474
+
475
+  // Enable this option and reduce the value to optimize screen updates.
476
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
477
+  //#define DOGM_SPI_DELAY_US 5
474 478
 #endif // DOGLCD
475 479
 
476 480
 // @section safety

+ 9
- 5
Marlin/example_configurations/makibox/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 9
- 5
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h 查看文件

@@ -460,15 +460,19 @@
460 460
 
461 461
 #endif // SDSUPPORT
462 462
 
463
-// for dogm lcd displays you can choose some additional fonts:
463
+// Some additional options are available for graphical displays:
464 464
 #if ENABLED(DOGLCD)
465
-  // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
466
-  // we don't have a big font for Cyrillic, Kana
465
+  // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
466
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
467 467
   //#define USE_BIG_EDIT_FONT
468 468
 
469
-  // If you have spare 2300Byte of progmem and want to use a
470
-  // smaller font on the Info-screen uncomment the next line.
469
+  // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM.
470
+  // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
471 471
   //#define USE_SMALL_INFOFONT
472
+
473
+  // Enable this option and reduce the value to optimize screen updates.
474
+  // The normal delay is 10µs. Use the lowest value that still gives a reliable display.
475
+  //#define DOGM_SPI_DELAY_US 5
472 476
 #endif // DOGLCD
473 477
 
474 478
 // @section safety

+ 7
- 1
Marlin/language.h 查看文件

@@ -276,7 +276,13 @@
276 276
 
277 277
 #include INCLUDE_LANGUAGE
278 278
 
279
-#if DISABLED(SIMULATE_ROMFONT) && DISABLED(DISPLAY_CHARSET_ISO10646_1) && DISABLED(DISPLAY_CHARSET_ISO10646_5) && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) && DISABLED(DISPLAY_CHARSET_ISO10646_CN) && DISABLED(DISPLAY_CHARSET_ISO10646_TR)
279
+#if DISABLED(SIMULATE_ROMFONT) \
280
+ && DISABLED(DISPLAY_CHARSET_ISO10646_1) \
281
+ && DISABLED(DISPLAY_CHARSET_ISO10646_5) \
282
+ && DISABLED(DISPLAY_CHARSET_ISO10646_KANA) \
283
+ && DISABLED(DISPLAY_CHARSET_ISO10646_GREEK) \
284
+ && DISABLED(DISPLAY_CHARSET_ISO10646_CN) \
285
+ && DISABLED(DISPLAY_CHARSET_ISO10646_TR)
280 286
   #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
281 287
 #endif
282 288
 

+ 5
- 5
Marlin/ultralcd.cpp 查看文件

@@ -2250,7 +2250,7 @@ void kill_screen(const char* lcd_msg) {
2250 2250
       END_SCREEN();
2251 2251
     }
2252 2252
 
2253
-    void lcd_filament_change_show_message(FilamentChangeMessage message) {
2253
+    void lcd_filament_change_show_message(const FilamentChangeMessage message) {
2254 2254
       switch (message) {
2255 2255
         case FILAMENT_CHANGE_MESSAGE_INIT:
2256 2256
           defer_return_to_status = true;
@@ -2849,20 +2849,20 @@ void lcd_finishstatus(bool persist=false) {
2849 2849
 
2850 2850
 bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
2851 2851
 
2852
-void lcd_setstatus(const char* message, bool persist) {
2852
+void lcd_setstatus(const char* const message, bool persist) {
2853 2853
   if (lcd_status_message_level > 0) return;
2854 2854
   strncpy(lcd_status_message, message, 3 * (LCD_WIDTH));
2855 2855
   lcd_finishstatus(persist);
2856 2856
 }
2857 2857
 
2858
-void lcd_setstatuspgm(const char* message, uint8_t level) {
2858
+void lcd_setstatuspgm(const char* const message, uint8_t level) {
2859 2859
   if (level < lcd_status_message_level) return;
2860 2860
   lcd_status_message_level = level;
2861 2861
   strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
2862 2862
   lcd_finishstatus(level > 0);
2863 2863
 }
2864 2864
 
2865
-void lcd_setalertstatuspgm(const char* message) {
2865
+void lcd_setalertstatuspgm(const char* const message) {
2866 2866
   lcd_setstatuspgm(message, 1);
2867 2867
   #if ENABLED(ULTIPANEL)
2868 2868
     lcd_return_to_status();
@@ -2872,7 +2872,7 @@ void lcd_setalertstatuspgm(const char* message) {
2872 2872
 void lcd_reset_alert_level() { lcd_status_message_level = 0; }
2873 2873
 
2874 2874
 #if HAS_LCD_CONTRAST
2875
-  void set_lcd_contrast(int value) {
2875
+  void set_lcd_contrast(const int value) {
2876 2876
     lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
2877 2877
     u8g.setContrast(lcd_contrast);
2878 2878
   }

+ 3
- 3
Marlin/ultralcd.h 查看文件

@@ -88,7 +88,7 @@
88 88
     void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
89 89
 
90 90
     #if ENABLED(FILAMENT_CHANGE_FEATURE)
91
-      void lcd_filament_change_show_message(FilamentChangeMessage message);
91
+      void lcd_filament_change_show_message(const FilamentChangeMessage message);
92 92
     #endif // FILAMENT_CHANGE_FEATURE
93 93
 
94 94
   #else
@@ -156,8 +156,8 @@
156 156
   inline void lcd_update() {}
157 157
   inline void lcd_init() {}
158 158
   inline bool lcd_hasstatus() { return false; }
159
-  inline void lcd_setstatus(const char* message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
160
-  inline void lcd_setstatuspgm(const char* message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
159
+  inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
160
+  inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
161 161
   inline void lcd_buttons_update() {}
162 162
   inline void lcd_reset_alert_level() {}
163 163
   inline bool lcd_detected() { return true; }

+ 288
- 150
Marlin/ultralcd_impl_DOGM.h 查看文件

@@ -54,6 +54,7 @@
54 54
   #include "_Bootscreen.h"
55 55
 #endif
56 56
 
57
+// Only Western languages support big / small fonts
57 58
 #if DISABLED(DISPLAY_CHARSET_ISO10646_1)
58 59
   #undef USE_BIG_EDIT_FONT
59 60
   #undef USE_SMALL_INFOFONT
@@ -122,7 +123,7 @@
122 123
 #if ENABLED(USE_BIG_EDIT_FONT)
123 124
   #define FONT_MENU_EDIT_NAME u8g_font_9x18
124 125
   #define DOG_CHAR_WIDTH_EDIT  9
125
-  #define DOG_CHAR_HEIGHT_EDIT 18
126
+  #define DOG_CHAR_HEIGHT_EDIT 13
126 127
   #define LCD_WIDTH_EDIT       14
127 128
 #else
128 129
   #define FONT_MENU_EDIT_NAME FONT_MENU_NAME
@@ -183,8 +184,15 @@
183 184
 int lcd_contrast;
184 185
 static char currentfont = 0;
185 186
 
186
-static void lcd_setFont(char font_nr) {
187
-  switch(font_nr) {
187
+// The current graphical page being rendered
188
+u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p;
189
+
190
+// For selective rendering within a Y range
191
+#define PAGE_UNDER(yb) (u8g.getU8g()->current_page.y0 <= (yb))
192
+#define PAGE_CONTAINS(ya, yb) (PAGE_UNDER(yb) && u8g.getU8g()->current_page.y1 >= (ya))
193
+
194
+static void lcd_setFont(const char font_nr) {
195
+  switch (font_nr) {
188 196
     case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break;
189 197
     case FONT_MENU       : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break;
190 198
     case FONT_SPECIAL    : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break;
@@ -193,7 +201,7 @@ static void lcd_setFont(char font_nr) {
193 201
   }
194 202
 }
195 203
 
196
-void lcd_print(char c) {
204
+void lcd_print(const char c) {
197 205
   if ((c > 0) && (c <= LCD_STR_SPECIAL_MAX)) {
198 206
     u8g.setFont(FONT_SPECIAL_NAME);
199 207
     u8g.print(c);
@@ -202,7 +210,7 @@ void lcd_print(char c) {
202 210
   else charset_mapper(c);
203 211
 }
204 212
 
205
-char lcd_print_and_count(char c) {
213
+char lcd_print_and_count(const char c) {
206 214
   if ((c > 0) && (c <= LCD_STR_SPECIAL_MAX)) {
207 215
     u8g.setFont(FONT_SPECIAL_NAME);
208 216
     u8g.print(c);
@@ -212,7 +220,7 @@ char lcd_print_and_count(char c) {
212 220
   else return charset_mapper(c);
213 221
 }
214 222
 
215
-void lcd_print(const char* str) {
223
+void lcd_print(const char* const str) {
216 224
   for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c);
217 225
 }
218 226
 
@@ -260,15 +268,15 @@ static void lcd_implementation_init() {
260 268
       }
261 269
     #endif // SHOW_CUSTOM_BOOTSCREEN
262 270
 
263
-    int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
271
+    const uint8_t offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
264 272
 
265 273
     #if ENABLED(START_BMPHIGH)
266
-      int offy = 0;
274
+      constexpr uint8_t offy = 0;
267 275
     #else
268
-      int offy = DOG_CHAR_HEIGHT;
276
+      constexpr uint8_t offy = DOG_CHAR_HEIGHT;
269 277
     #endif
270 278
 
271
-    int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
279
+    const uint8_t txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
272 280
 
273 281
     if (show_bootscreen) {
274 282
       u8g.firstPage();
@@ -278,7 +286,7 @@ static void lcd_implementation_init() {
278 286
         #ifndef STRING_SPLASH_LINE2
279 287
           u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1);
280 288
         #else
281
-          int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2;
289
+          const uint8_t txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2;
282 290
           u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1);
283 291
           u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
284 292
         #endif
@@ -307,37 +315,41 @@ static void lcd_implementation_clear() { } // Automatically cleared by Picture L
307 315
 // Status Screen
308 316
 //
309 317
 
310
-FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
311
-  int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
318
+FORCE_INLINE void _draw_centered_temp(const int temp, const uint8_t x, const uint8_t y) {
319
+  const uint8_t degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
312 320
   u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
313 321
   lcd_print(itostr3(temp));
314 322
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
315 323
 }
316 324
 
317
-FORCE_INLINE void _draw_heater_status(int x, int heater) {
325
+FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater) {
318 326
   #if HAS_TEMP_BED
319 327
     bool isBed = heater < 0;
320 328
   #else
321 329
     const bool isBed = false;
322 330
   #endif
323 331
 
324
-  _draw_centered_temp((isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)) + 0.5, x, 7);
332
+  if (PAGE_UNDER(7))
333
+    _draw_centered_temp((isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)) + 0.5, x, 7);
325 334
 
326
-  _draw_centered_temp((isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)) + 0.5, x, 28);
335
+  if (PAGE_CONTAINS(21, 28))
336
+    _draw_centered_temp((isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)) + 0.5, x, 28);
327 337
 
328
-  int h = isBed ? 7 : 8,
329
-      y = isBed ? 18 : 17;
330
-  if (isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater)) {
331
-    u8g.setColorIndex(0); // white on black
332
-    u8g.drawBox(x + h, y, 2, 2);
333
-    u8g.setColorIndex(1); // black on white
334
-  }
335
-  else {
336
-    u8g.drawBox(x + h, y, 2, 2);
338
+  if (PAGE_CONTAINS(17, 20)) {
339
+    const uint8_t h = isBed ? 7 : 8,
340
+                  y = isBed ? 18 : 17;
341
+    if (isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater)) {
342
+      u8g.setColorIndex(0); // white on black
343
+      u8g.drawBox(x + h, y, 2, 2);
344
+      u8g.setColorIndex(1); // black on white
345
+    }
346
+    else {
347
+      u8g.drawBox(x + h, y, 2, 2);
348
+    }
337 349
   }
338 350
 }
339 351
 
340
-FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
352
+FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) {
341 353
   if (blink)
342 354
     lcd_printPGM(pstr);
343 355
   else {
@@ -357,49 +369,107 @@ FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink)
357 369
 //#define DOGM_SD_PERCENT
358 370
 
359 371
 static void lcd_implementation_status_screen() {
360
-  u8g.setColorIndex(1); // black on white
361 372
 
362 373
   bool blink = lcd_blink();
363 374
 
364
-  // Symbols menu graphics, animated fan
365
-  u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT,
366
-    #if HAS_FAN0
367
-      blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp
368
-    #else
369
-      status_screen0_bmp
370
-    #endif
371
-  );
375
+  // Black color, white background
376
+  u8g.setColorIndex(1);
372 377
 
373
-  // Status Menu Font for SD info, Heater status, Fan, XYZ
378
+  // Status Menu Font
374 379
   lcd_setFont(FONT_STATUSMENU);
375 380
 
381
+  //
382
+  // Fan Animation
383
+  //
384
+
385
+  if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) {
386
+
387
+    u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT,
388
+      #if HAS_FAN0
389
+        blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp
390
+      #else
391
+        status_screen0_bmp
392
+      #endif
393
+    );
394
+
395
+  }
396
+
397
+  //
398
+  // Temperature Graphics and Info
399
+  //
400
+
401
+  if (PAGE_UNDER(28)) {
402
+    // Extruders
403
+    HOTEND_LOOP() _draw_heater_status(5 + e * 25, e);
404
+
405
+    // Heated bed
406
+    #if HOTENDS < 4 && HAS_TEMP_BED
407
+      _draw_heater_status(81, -1);
408
+    #endif
409
+
410
+    if (PAGE_CONTAINS(20, 27)) {
411
+      // Fan
412
+      u8g.setPrintPos(104, 27);
413
+      #if HAS_FAN0
414
+        int per = ((fanSpeeds[0] + 1) * 100) / 256;
415
+        if (per) {
416
+          lcd_print(itostr3(per));
417
+          u8g.print('%');
418
+        }
419
+      #endif
420
+    }
421
+  }
422
+
376 423
   #if ENABLED(SDSUPPORT)
424
+
425
+    //
377 426
     // SD Card Symbol
378
-    u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);
379
-    u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5);
380
-    u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4);
381
-    u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION));
427
+    //
428
+
429
+    if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
430
+      // Upper box
431
+      u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);     // 42-48 (or 41-47)
432
+      // Right edge
433
+      u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5);     // 44-48 (or 43-47)
434
+      // Bottom hollow box
435
+      u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4);  // 49-52 (or 48-51)
436
+      // Corner pixel
437
+      u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION));         // 43 (or 42)
438
+    }
382 439
 
440
+    //
383 441
     // Progress bar frame
384
-    u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));
442
+    //
443
+
444
+    if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION)))
445
+      u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));  // 49-52 (or 49-51)
385 446
 
386
-    // SD Card Progress bar and clock
387 447
     if (IS_SD_PRINTING) {
448
+
449
+      //
388 450
       // Progress bar solid part
389
-      u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
390
-    
451
+      //
452
+
453
+      if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))
454
+        u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
455
+
456
+      //
457
+      // SD Percent Complete
458
+      //
459
+
391 460
       #if ENABLED(DOGM_SD_PERCENT)
392
-        // Percent complete
393
-        u8g.setPrintPos(55, 48);
394
-        u8g.print(itostr3(card.percentDone()));
395
-        u8g.print('%');
461
+        if (PAGE_CONTAINS(41, 48)) {
462
+          // Percent complete
463
+          u8g.setPrintPos(55, 48);
464
+          u8g.print(itostr3(card.percentDone()));
465
+          u8g.print('%');
466
+        }
396 467
       #endif
397 468
     }
398 469
 
399
-    char buffer[10];
400
-    duration_t elapsed = print_job_timer.duration();
401
-    bool has_days = (elapsed.value > 60*60*24L);
402
-    elapsed.toDigital(buffer, has_days);
470
+    //
471
+    // Elapsed Time
472
+    //
403 473
 
404 474
     #if DISABLED(DOGM_SD_PERCENT)
405 475
       #define SD_DURATION_X 71
@@ -407,113 +477,167 @@ static void lcd_implementation_status_screen() {
407 477
       #define SD_DURATION_X 89
408 478
     #endif
409 479
 
410
-    u8g.setPrintPos(SD_DURATION_X + (has_days ? 0 : 9), 48);
411
-    lcd_print(buffer);
480
+    if (PAGE_CONTAINS(41, 48)) {
481
+
482
+      char buffer[10];
483
+      duration_t elapsed = print_job_timer.duration();
484
+      bool has_days = (elapsed.value > 60*60*24L);
485
+      elapsed.toDigital(buffer, has_days);
486
+
487
+      u8g.setPrintPos(SD_DURATION_X + (has_days ? 0 : 9), 48);
488
+      lcd_print(buffer);
489
+    }
412 490
 
413 491
   #endif
414 492
 
415
-  // Extruders
416
-  HOTEND_LOOP() _draw_heater_status(5 + e * 25, e);
493
+  //
494
+  // XYZ Coordinates
495
+  //
417 496
 
418
-  // Heated bed
419
-  #if HOTENDS < 4 && HAS_TEMP_BED
420
-    _draw_heater_status(81, -1);
497
+  #if ENABLED(USE_SMALL_INFOFONT)
498
+    #define INFO_FONT_HEIGHT 7
499
+  #else
500
+    #define INFO_FONT_HEIGHT 8
421 501
   #endif
422 502
 
423
-  // Fan
424
-  u8g.setPrintPos(104, 27);
425
-  #if HAS_FAN0
426
-    int per = ((fanSpeeds[0] + 1) * 100) / 256;
427
-    if (per) {
428
-      lcd_print(itostr3(per));
429
-      u8g.print('%');
430
-    }
503
+  #define XYZ_BASELINE (30 + INFO_FONT_HEIGHT)
504
+
505
+  #define X_LABEL_POS  3
506
+  #define X_VALUE_POS 11
507
+  #define XYZ_SPACING 40
508
+
509
+  // Enable to save many cycles by drawing a hollow frame
510
+  #define XYZ_HOLLOW_FRAME
511
+
512
+  #if ENABLED(XYZ_HOLLOW_FRAME)
513
+    #define XYZ_FRAME_TOP 29
514
+    #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 3
515
+  #else
516
+    #define XYZ_FRAME_TOP 30
517
+    #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 2
431 518
   #endif
432 519
 
433
-  // X, Y, Z-Coordinates
434 520
   // Before homing the axis letters are blinking 'X' <-> '?'.
435 521
   // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
436 522
   // When everything is ok you see a constant 'X'.
437
-  #define XYZ_BASELINE 38
438 523
 
439
-  #if ENABLED(USE_SMALL_INFOFONT)
440
-    u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 10);
441
-  #else
442
-    u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 9);
443
-  #endif
444
-  u8g.setColorIndex(0); // white on black
524
+  static char xstring[5], ystring[5], zstring[7];
445 525
 
446
-  u8g.setPrintPos(2, XYZ_BASELINE);
447
-  _draw_axis_label(X_AXIS, PSTR(MSG_X), blink);
448
-  u8g.setPrintPos(10, XYZ_BASELINE);
449
-  lcd_print(ftostr4sign(current_position[X_AXIS]));
526
+  // At the first page, regenerate the XYZ strings
527
+  if (page.page == 0) {
528
+    strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
529
+    strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
530
+    strcpy(zstring, ftostr52sp(current_position[Z_AXIS] + 0.00001));
531
+  }
450 532
 
451
-  u8g.setPrintPos(43, XYZ_BASELINE);
452
-  _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
453
-  u8g.setPrintPos(51, XYZ_BASELINE);
454
-  lcd_print(ftostr4sign(current_position[Y_AXIS]));
533
+  if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) {
455 534
 
456
-  u8g.setPrintPos(83, XYZ_BASELINE);
457
-  _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
458
-  u8g.setPrintPos(91, XYZ_BASELINE);
459
-  lcd_print(ftostr52sp(current_position[Z_AXIS] + 0.00001));
535
+    #if ENABLED(XYZ_HOLLOW_FRAME)
536
+      u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40  7: 29-39
537
+    #else
538
+      u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT);   // 8: 30-39  7: 30-37
539
+    #endif
460 540
 
461
-  u8g.setColorIndex(1); // black on white
541
+    if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_HEIGHT - 1), XYZ_BASELINE)) {
462 542
 
543
+      #if DISABLED(XYZ_HOLLOW_FRAME)
544
+        u8g.setColorIndex(0); // white on black
545
+      #endif
546
+
547
+      u8g.setPrintPos(0 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
548
+      _draw_axis_label(X_AXIS, PSTR(MSG_X), blink);
549
+      u8g.setPrintPos(0 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
550
+      lcd_print(xstring);
551
+
552
+      u8g.setPrintPos(1 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
553
+      _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
554
+      u8g.setPrintPos(1 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
555
+      lcd_print(ystring);
556
+
557
+      u8g.setPrintPos(2 * XYZ_SPACING + X_LABEL_POS, XYZ_BASELINE);
558
+      _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
559
+      u8g.setPrintPos(2 * XYZ_SPACING + X_VALUE_POS, XYZ_BASELINE);
560
+      lcd_print(zstring);
561
+
562
+      #if DISABLED(XYZ_HOLLOW_FRAME)
563
+        u8g.setColorIndex(1); // black on white
564
+      #endif
565
+    }
566
+  }
567
+
568
+  //
463 569
   // Feedrate
464
-  lcd_setFont(FONT_MENU);
465
-  u8g.setPrintPos(3, 49);
466
-  lcd_print(LCD_STR_FEEDRATE[0]);
570
+  //
467 571
 
468
-  lcd_setFont(FONT_STATUSMENU);
469
-  u8g.setPrintPos(12, 49);
470
-  lcd_print(itostr3(feedrate_percentage));
471
-  u8g.print('%');
572
+  if (PAGE_CONTAINS(50 - INFO_FONT_HEIGHT, 49)) {
573
+    lcd_setFont(FONT_MENU);
574
+    u8g.setPrintPos(3, 49);
575
+    lcd_print(LCD_STR_FEEDRATE[0]);
472 576
 
577
+    lcd_setFont(FONT_STATUSMENU);
578
+    u8g.setPrintPos(12, 49);
579
+    lcd_print(itostr3(feedrate_percentage));
580
+    u8g.print('%');
581
+  }
582
+
583
+  //
473 584
   // Status line
474
-  #if ENABLED(USE_SMALL_INFOFONT)
475
-    u8g.setPrintPos(0, 62);
476
-  #else
477
-    u8g.setPrintPos(0, 63);
478
-  #endif
479
-  #if DISABLED(FILAMENT_LCD_DISPLAY)
480
-    lcd_print(lcd_status_message);
481
-  #else
482
-    if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
585
+  //
586
+
587
+  #define STATUS_BASELINE (54 + INFO_FONT_HEIGHT)
588
+
589
+  if (PAGE_CONTAINS(STATUS_BASELINE + 1 - INFO_FONT_HEIGHT, STATUS_BASELINE)) {
590
+    u8g.setPrintPos(0, STATUS_BASELINE);
591
+
592
+    #if DISABLED(FILAMENT_LCD_DISPLAY)
483 593
       lcd_print(lcd_status_message);
484
-    }
485
-    else {
486
-      lcd_printPGM(PSTR("dia:"));
487
-      lcd_print(ftostr12ns(filament_width_meas));
488
-      lcd_printPGM(PSTR(" factor:"));
489
-      lcd_print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
490
-      u8g.print('%');
491
-    }
492
-  #endif
594
+    #else
595
+      if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
596
+        lcd_print(lcd_status_message);
597
+      }
598
+      else {
599
+        lcd_printPGM(PSTR("dia:"));
600
+        lcd_print(ftostr12ns(filament_width_meas));
601
+        lcd_printPGM(PSTR(" factor:"));
602
+        lcd_print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
603
+        u8g.print('%');
604
+      }
605
+    #endif
606
+  }
493 607
 }
494 608
 
495 609
 #if ENABLED(ULTIPANEL)
496 610
 
611
+  uint8_t row_y1, row_y2;
612
+
497 613
   // Set the colors for a menu item based on whether it is selected
498
-  static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
614
+  static void lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) {
615
+
616
+    row_y1 = row * (DOG_CHAR_HEIGHT) + 1;
617
+    row_y2 = row_y1 + (DOG_CHAR_HEIGHT) - 1;
618
+
619
+    if (!PAGE_CONTAINS(row_y1 + 2 - (TALL_FONT_CORRECTION), row_y2 + 2 - (TALL_FONT_CORRECTION))) return;
620
+
499 621
     if (isSelected) {
500 622
       u8g.setColorIndex(1);  // black on white
501
-      u8g.drawBox(0, row * (DOG_CHAR_HEIGHT) + 3 - (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
623
+      u8g.drawBox(0, row_y1 + 2 - (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
502 624
       u8g.setColorIndex(0);  // following text must be white on black
503 625
     }
504 626
     else {
505 627
       u8g.setColorIndex(1); // unmarked text is black on white
506 628
     }
507
-    u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
629
+    u8g.setPrintPos((START_COL) * (DOG_CHAR_WIDTH), row_y2);
508 630
   }
509 631
 
510 632
   #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
511 633
 
512 634
     // Draw a static line of text in the same idiom as a menu item
513
-    static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
635
+    static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char* valstr=NULL) {
514 636
 
515 637
       lcd_implementation_mark_as_selected(row, invert);
516 638
 
639
+      if (!PAGE_CONTAINS(row_y1, row_y2)) return;
640
+
517 641
       char c;
518 642
       int8_t n = LCD_WIDTH - (START_COL);
519 643
 
@@ -535,20 +659,20 @@ static void lcd_implementation_status_screen() {
535 659
   #endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
536 660
 
537 661
   // Draw a generic menu item
538
-  static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
662
+  static void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, const char* pstr, const char pre_char, const char post_char) {
539 663
     UNUSED(pre_char);
540 664
 
541
-    char c;
542
-    uint8_t n = LCD_WIDTH - (START_COL) - 2;
543
-
544 665
     lcd_implementation_mark_as_selected(row, isSelected);
545 666
 
546
-    while (c = pgm_read_byte(pstr)) {
667
+    if (!PAGE_CONTAINS(row_y1, row_y2)) return;
668
+
669
+    uint8_t n = LCD_WIDTH - (START_COL) - 2;
670
+    while (char c = pgm_read_byte(pstr)) {
547 671
       n -= lcd_print_and_count(c);
548 672
       pstr++;
549 673
     }
550 674
     while (n--) u8g.print(' ');
551
-    u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
675
+    u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), row_y2);
552 676
     lcd_print(post_char);
553 677
     u8g.print(' ');
554 678
   }
@@ -560,20 +684,22 @@ static void lcd_implementation_status_screen() {
560 684
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
561 685
 
562 686
   // Draw a menu item with an editable value
563
-  static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
564
-    char c;
565
-    uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
566
-    uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen;
687
+  static void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, const char* pstr, const char* const data, const bool pgm) {
567 688
 
568 689
     lcd_implementation_mark_as_selected(row, isSelected);
569 690
 
570
-    while (c = pgm_read_byte(pstr)) {
691
+    if (!PAGE_CONTAINS(row_y1, row_y2)) return;
692
+
693
+    const uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
694
+    uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen;
695
+
696
+    while (char c = pgm_read_byte(pstr)) {
571 697
       n -= lcd_print_and_count(c);
572 698
       pstr++;
573 699
     }
574 700
     u8g.print(':');
575 701
     while (n--) u8g.print(' ');
576
-    u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, (row + 1) * (DOG_CHAR_HEIGHT));
702
+    u8g.setPrintPos(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, row_y2);
577 703
     if (pgm)  lcd_printPGM(data);  else  lcd_print((char*)data);
578 704
   }
579 705
 
@@ -603,53 +729,65 @@ static void lcd_implementation_status_screen() {
603 729
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
604 730
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
605 731
 
606
-  void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
607
-    uint8_t rows = 1;
608
-    uint8_t lcd_width = LCD_WIDTH - (START_COL), char_width = DOG_CHAR_WIDTH;
609
-    uint8_t vallen = lcd_strlen(value);
732
+  void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) {
733
+    const uint8_t labellen = lcd_strlen_P(pstr), vallen = lcd_strlen(value);
734
+    uint8_t lcd_width, char_width,
735
+            rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
610 736
 
611 737
     #if ENABLED(USE_BIG_EDIT_FONT)
612
-      if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
613
-        lcd_setFont(FONT_MENU_EDIT);
738
+      if (labellen <= LCD_WIDTH_EDIT - 1) {
739
+        if (labellen >= LCD_WIDTH_EDIT - vallen) rows = 2;
614 740
         lcd_width = LCD_WIDTH_EDIT + 1;
615 741
         char_width = DOG_CHAR_WIDTH_EDIT;
616
-        if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - vallen) rows = 2;
742
+        lcd_setFont(FONT_MENU_EDIT);
617 743
       }
618 744
       else {
745
+        lcd_width = LCD_WIDTH - (START_COL);
746
+        char_width = DOG_CHAR_WIDTH;
619 747
         lcd_setFont(FONT_MENU);
620 748
       }
749
+    #else
750
+      lcd_width = LCD_WIDTH - (START_COL);
751
+      char_width = DOG_CHAR_WIDTH;
621 752
     #endif
622 753
 
623
-    if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - vallen) rows = 2;
754
+    // Center either one or two rows
755
+    const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3
756
+    uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2;
624 757
 
625
-    const float kHalfChar = (DOG_CHAR_HEIGHT_EDIT) / 2;
626
-    float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
758
+    if (PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline)) {
759
+      u8g.setPrintPos(0, baseline);
760
+      lcd_printPGM(pstr);
761
+    }
627 762
 
628
-    u8g.setPrintPos(0, rowHeight + kHalfChar);
629
-    lcd_printPGM(pstr);
630 763
     if (value != NULL) {
631
-      u8g.print(':');
632
-      u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, rows * rowHeight + kHalfChar);
633
-      lcd_print(value);
764
+      baseline += (rows - 1) * segmentHeight;
765
+      if (PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline)) {
766
+        u8g.print(':');
767
+        u8g.setPrintPos((lcd_width - 1 - vallen) * char_width, baseline);
768
+        lcd_print(value);
769
+      }
634 770
     }
635 771
   }
636 772
 
637 773
   #if ENABLED(SDSUPPORT)
638 774
 
639
-    static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) {
775
+    static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const bool isDir) {
640 776
       UNUSED(pstr);
641
-      char c;
642
-      uint8_t n = LCD_WIDTH - (START_COL) - 1;
643 777
 
778
+      lcd_implementation_mark_as_selected(row, isSelected);
779
+
780
+      if (!PAGE_CONTAINS(row_y1, row_y2)) return;
781
+
782
+      uint8_t n = LCD_WIDTH - (START_COL) - 1;
644 783
       if (longFilename[0]) {
645 784
         filename = longFilename;
646 785
         longFilename[n] = '\0';
647 786
       }
648 787
 
649
-      lcd_implementation_mark_as_selected(row, isSelected);
650
-
651 788
       if (isDir) lcd_print(LCD_STR_FOLDER[0]);
652
-      while ((c = *filename)) {
789
+
790
+      while (char c = *filename) {
653 791
         n -= lcd_print_and_count(c);
654 792
         filename++;
655 793
       }

+ 16
- 16
Marlin/ultralcd_impl_HD44780.h 查看文件

@@ -195,7 +195,7 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
195 195
 
196 196
 static void lcd_set_custom_characters(
197 197
   #if ENABLED(LCD_PROGRESS_BAR)
198
-    bool info_screen_charset = true
198
+    const bool info_screen_charset = true
199 199
   #endif
200 200
 ) {
201 201
   static byte bedTemp[8] = {
@@ -341,7 +341,7 @@ static void lcd_set_custom_characters(
341 341
 
342 342
 static void lcd_implementation_init(
343 343
   #if ENABLED(LCD_PROGRESS_BAR)
344
-    bool info_screen_charset = true
344
+    const bool info_screen_charset = true
345 345
   #endif
346 346
 ) {
347 347
 
@@ -385,7 +385,7 @@ void lcd_printPGM(const char *str) {
385 385
   for (; char c = pgm_read_byte(str); ++str) charset_mapper(c);
386 386
 }
387 387
 
388
-void lcd_print(const char* str) {
388
+void lcd_print(const char* const str) {
389 389
   for (uint8_t i = 0; char c = str[i]; ++i) charset_mapper(c);
390 390
 }
391 391
 
@@ -393,14 +393,14 @@ void lcd_print(char c) { charset_mapper(c); }
393 393
 
394 394
 #if ENABLED(SHOW_BOOTSCREEN)
395 395
 
396
-  void lcd_erase_line(int line) {
396
+  void lcd_erase_line(const int line) {
397 397
     lcd.setCursor(0, line);
398
-    for (int i = 0; i < LCD_WIDTH; i++)
398
+    for (uint8_t i = LCD_WIDTH + 1; --i;)
399 399
       lcd_print(' ');
400 400
   }
401 401
 
402 402
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
403
-  void lcd_scroll(int col, int line, const char* text, int len, int time) {
403
+  void lcd_scroll(const int col, const int line, const char* const text, const int len, const int time) {
404 404
     char tmp[LCD_WIDTH + 1] = {0};
405 405
     int n = max(lcd_strlen_P(text) - len, 0);
406 406
     for (int i = 0; i <= n; i++) {
@@ -411,7 +411,7 @@ void lcd_print(char c) { charset_mapper(c); }
411 411
     }
412 412
   }
413 413
 
414
-  static void logo_lines(const char *extra) {
414
+  static void logo_lines(const char* const extra) {
415 415
     int indent = (LCD_WIDTH - 8 - lcd_strlen_P(extra)) / 2;
416 416
     lcd.setCursor(indent, 0); lcd.print('\x00'); lcd_printPGM(PSTR( "------" ));  lcd.print('\x01');
417 417
     lcd.setCursor(indent, 1);                    lcd_printPGM(PSTR("|Marlin|"));  lcd_printPGM(extra);
@@ -552,7 +552,7 @@ void lcd_kill_screen() {
552 552
   lcd_printPGM(PSTR(MSG_PLEASE_RESET));
553 553
 }
554 554
 
555
-FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
555
+FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) {
556 556
   if (blink)
557 557
     lcd_printPGM(pstr);
558 558
   else {
@@ -794,7 +794,7 @@ static void lcd_implementation_status_screen() {
794 794
 
795 795
   #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
796 796
 
797
-    static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char *valstr=NULL) {
797
+    static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL) {
798 798
       UNUSED(invert);
799 799
       char c;
800 800
       int8_t n = LCD_WIDTH;
@@ -816,7 +816,7 @@ static void lcd_implementation_status_screen() {
816 816
 
817 817
   #endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
818 818
 
819
-  static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
819
+  static void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char post_char) {
820 820
     char c;
821 821
     uint8_t n = LCD_WIDTH - 2;
822 822
     lcd.setCursor(0, row);
@@ -829,7 +829,7 @@ static void lcd_implementation_status_screen() {
829 829
     lcd.print(post_char);
830 830
   }
831 831
 
832
-  static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
832
+  static void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) {
833 833
     char c;
834 834
     uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data);
835 835
     lcd.setCursor(0, row);
@@ -842,7 +842,7 @@ static void lcd_implementation_status_screen() {
842 842
     while (n--) lcd.print(' ');
843 843
     lcd_print(data);
844 844
   }
845
-  static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
845
+  static void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) {
846 846
     char c;
847 847
     uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data);
848 848
     lcd.setCursor(0, row);
@@ -879,7 +879,7 @@ static void lcd_implementation_status_screen() {
879 879
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
880 880
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
881 881
 
882
-  void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
882
+  void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) {
883 883
     lcd.setCursor(1, 1);
884 884
     lcd_printPGM(pstr);
885 885
     if (value != NULL) {
@@ -891,7 +891,7 @@ static void lcd_implementation_status_screen() {
891 891
 
892 892
   #if ENABLED(SDSUPPORT)
893 893
 
894
-    static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) {
894
+    static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const uint8_t concat, const char post_char) {
895 895
       UNUSED(pstr);
896 896
       char c;
897 897
       uint8_t n = LCD_WIDTH - concat;
@@ -909,11 +909,11 @@ static void lcd_implementation_status_screen() {
909 909
       lcd.print(post_char);
910 910
     }
911 911
 
912
-    static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
912
+    static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) {
913 913
       lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' ');
914 914
     }
915 915
 
916
-    static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
916
+    static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) {
917 917
       lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]);
918 918
     }
919 919
 

+ 19
- 13
Marlin/ultralcd_st7920_u8glib_rrd.h 查看文件

@@ -106,12 +106,18 @@ static void ST7920_SWSPI_SND_8BIT(uint8_t val) {
106 106
   ST7920_SND_BIT; // 8
107 107
 }
108 108
 
109
-#define ST7920_CS()              {WRITE(ST7920_CS_PIN,1);u8g_10MicroDelay();}
110
-#define ST7920_NCS()             {WRITE(ST7920_CS_PIN,0);}
111
-#define ST7920_SET_CMD()         {ST7920_SWSPI_SND_8BIT(0xf8);u8g_10MicroDelay();}
112
-#define ST7920_SET_DAT()         {ST7920_SWSPI_SND_8BIT(0xfa);u8g_10MicroDelay();}
113
-#define ST7920_WRITE_BYTE(a)     {ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xf0u));ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u));u8g_10MicroDelay();}
114
-#define ST7920_WRITE_BYTES(p,l)  {uint8_t i;for(i=0;i<l;i++){ST7920_SWSPI_SND_8BIT(*p&0xf0);ST7920_SWSPI_SND_8BIT(*p<<4);p++;}u8g_10MicroDelay();}
109
+#if defined(DOGM_SPI_DELAY_US) && DOGM_SPI_DELAY_US > 0
110
+  #define U8G_DELAY() delayMicroseconds(DOGM_SPI_DELAY_US)
111
+#else
112
+  #define U8G_DELAY() u8g_10MicroDelay()
113
+#endif
114
+
115
+#define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
116
+#define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
117
+#define ST7920_SET_CMD()         { ST7920_SWSPI_SND_8BIT(0xf8); U8G_DELAY(); }
118
+#define ST7920_SET_DAT()         { ST7920_SWSPI_SND_8BIT(0xfa); U8G_DELAY(); }
119
+#define ST7920_WRITE_BYTE(a)     { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xf0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u)); U8G_DELAY(); }
120
+#define ST7920_WRITE_BYTES(p,l)  { for (uint8_t i = l + 1; --i;) { ST7920_SWSPI_SND_8BIT(*p&0xf0); ST7920_SWSPI_SND_8BIT(*p<<4); p++; } U8G_DELAY(); }
115 121
 
116 122
 uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
117 123
   uint8_t i, y;
@@ -167,13 +173,13 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
167 173
     }
168 174
     break;
169 175
   }
170
-#if PAGE_HEIGHT == 8
171
-  return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg);
172
-#elif PAGE_HEIGHT == 16
173
-  return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg);
174
-#else
175
-  return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg);
176
-#endif
176
+  #if PAGE_HEIGHT == 8
177
+    return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg);
178
+  #elif PAGE_HEIGHT == 16
179
+    return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg);
180
+  #else
181
+    return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg);
182
+  #endif
177 183
 }
178 184
 
179 185
 uint8_t   u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U8G_NOCOMMON;

+ 68
- 68
Marlin/utf_mapper.h 查看文件

@@ -48,34 +48,34 @@
48 48
     #if ENABLED(MAPPER_C2C3)
49 49
       const PROGMEM uint8_t utf_recode[] =
50 50
            { // 0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f          This is fair for symbols
51
-             0x20,0x3f,0xec,0xed,0x3f,0x5c,0x7c,0x3f,0x22,0x63,0x61,0x7f,0x3f,0x3f,0x52,0xb0,  // c2a
52
-  //          ' '       ¢    £         ­    l         "    c    a    «              R
53
-             0xdf,0x3f,0x32,0x33,0x27,0xe4,0xf1,0xa5,0x2c,0x31,0xdf,0x7e,0x3f,0x3f,0x3f,0x3f,  // c2b but relatively bad for letters.
54
-  //          °         2    3    `    N    p    .    ,    1    °    »
55
-             0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,  // c38
56
-  //                              ä
57
-             0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0xef,0x78,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0xe2,  // c39 missing characters display as '?'
58
-  //                                        ö     x                       ü              ß
59
-             0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,  // c3a
60
-  //                              ä
61
-             0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xfd,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f   // c3b
62
-  //               n                        ö    ÷                        ü
51
+               0x20,0x3f,0xec,0xed,0x3f,0x5c,0x7c,0x3f,0x22,0x63,0x61,0x7f,0x3f,0x3f,0x52,0xb0,  // c2a
52
+             //' '        ¢    £         ­     l         "    c    a    «              R
53
+               0xdf,0x3f,0x32,0x33,0x27,0xe4,0xf1,0xa5,0x2c,0x31,0xdf,0x7e,0x3f,0x3f,0x3f,0x3f,  // c2b but relatively bad for letters.
54
+             // °         2    3    `    N    p    .    ,    1    °    »
55
+               0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,  // c38
56
+             //                     ä
57
+               0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0xef,0x78,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0xe2,  // c39 missing characters display as '?'
58
+             //                               ö    x                        ü              ß
59
+               0x3f,0x3f,0x3f,0x3f,0xe1,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,  // c3a
60
+             //                     ä
61
+               0x3f,0xee,0x3f,0x3f,0x3f,0x3f,0xef,0xfd,0x3f,0x3f,0x3f,0x3f,0xf5,0x3f,0x3f,0x3f   // c3b
62
+             //      n                        ö    ÷                        ü
63 63
            };
64 64
     #elif ENABLED(MAPPER_E382E383)
65 65
       const PROGMEM uint8_t utf_recode[] =
66 66
            { // 0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f
67
-             0x3d,0xb1,0xb1,0xa8,0xb2,0xa9,0xb3,0xaa,0xb4,0xab,0xb5,0xb6,0xb6,0xb7,0xb7,0xb8,  // e382a Please test and correct
68
-  //          =    ア    ア    ィ    イ    ゥ    ウ    ェ    エ    ォ    オ   ガ    ガ    キ   キ    ク
69
-             0xb8,0xb9,0xb9,0xba,0xba,0xbb,0xbb,0xbc,0xbc,0xbd,0xbd,0xbe,0xbe,0xbf,0xbf,0xc0,  // e382b
70
-  //          ク    ケ    ケ   コ    コ    サ    サ    シ    シ   ス    ス    セ    セ    ソ   ソ    タ
71
-             0xc0,0xc1,0xc1,0xc2,0xc2,0xc2,0xc3,0xc3,0xc4,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,  // e3838
72
-  //          タ    チ    チ    ッ    ッ    ッ    テ   テ    ト    ト    ナ    ニ    ヌ    ネ   ノ    ハ
73
-             0xca,0xca,0xcb,0xcb,0xcb,0xcc,0xcc,0xcc,0xcd,0xcd,0xcd,0xce,0xce,0xce,0xcf,0xd0,  // e3839
74
-  //          ハ    ハ    ヒ   ヒ    ヒ     フ    フ   フ    ヘ    ヘ    ヘ    ホ    ホ    ホ   マ    ミ
75
-             0xd1,0xd2,0xd3,0xd4,0xd4,0xd5,0xd5,0xae,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdc,  // e383a
76
-  //          ム    メ    モ    ャ   ャ    ユ    ユ    ョ    ヨ    ラ    リ    ル    レ    ロ   ワ    ワ
77
-             0xec,0xa7,0xa6,0xdd,0xcc,0x3f,0x3f,0x3f,0x3f,0x3f,0xa6,0xa5,0xb0,0xa4,0xa4,0x3f   // e383b
78
-  //          ヰ    ヱ    ヲ    ン    フ    ?    ?   ?    ?    ?    ヲ    ・    ー    ヽ    ヽ   ?
67
+               0x3d,0xb1,0xb1,0xa8,0xb2,0xa9,0xb3,0xaa,0xb4,0xab,0xb5,0xb6,0xb6,0xb7,0xb7,0xb8,  // e382a Please test and correct
68
+             // =    ア    ア    ィ    イ    ゥ    ウ    ェ    エ    ォ    オ   ガ    ガ    キ   キ    ク
69
+               0xb8,0xb9,0xb9,0xba,0xba,0xbb,0xbb,0xbc,0xbc,0xbd,0xbd,0xbe,0xbe,0xbf,0xbf,0xc0,  // e382b
70
+             // ク    ケ    ケ   コ    コ    サ    サ    シ    シ   ス    ス    セ    セ    ソ   ソ    タ
71
+               0xc0,0xc1,0xc1,0xc2,0xc2,0xc2,0xc3,0xc3,0xc4,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,  // e3838
72
+             // タ    チ    チ    ッ    ッ    ッ    テ   テ    ト    ト    ナ    ニ    ヌ    ネ   ノ    ハ
73
+               0xca,0xca,0xcb,0xcb,0xcb,0xcc,0xcc,0xcc,0xcd,0xcd,0xcd,0xce,0xce,0xce,0xcf,0xd0,  // e3839
74
+             // ハ    ハ    ヒ   ヒ    ヒ     フ    フ   フ    ヘ    ヘ    ヘ    ホ    ホ    ホ   マ    ミ
75
+               0xd1,0xd2,0xd3,0xd4,0xd4,0xd5,0xd5,0xae,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdc,  // e383a
76
+             // ム    メ    モ    ャ   ャ    ユ    ユ    ョ    ヨ    ラ    リ    ル    レ    ロ   ワ    ワ
77
+               0xec,0xa7,0xa6,0xdd,0xcc,0x3f,0x3f,0x3f,0x3f,0x3f,0xa6,0xa5,0xb0,0xa4,0xa4,0x3f   // e383b
78
+             // ヰ    ヱ    ヲ    ン    フ    ?    ?   ?    ?    ?    ヲ    ・    ー    ヽ    ヽ   ?
79 79
            };
80 80
     #elif ENABLED(MAPPER_D0D1)
81 81
       #error "Cyrillic on a JAPANESE display makes no sense. There are no matching symbols."
@@ -85,31 +85,31 @@
85 85
     #if ENABLED(MAPPER_C2C3)
86 86
       const PROGMEM uint8_t utf_recode[] =
87 87
            { // 0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f   This is relative complete.
88
-             0x20,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0x22,0xa9,0xaa,0xab,0x3f,0x3f,0xae,0x3f,  // c2a ¡¢£¤¥¦§¨©ª«¬­®¯
89
-  //         ' '   ¡    ¢    £    ¤    ¥    ¦    §    "    ©    ª    «    ?    ?    ®    ?
90
-             0xb0,0xb1,0xb2,0xb3,0x27,0xb5,0xb6,0xb7,0x2c,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,  // c2b °±²³´µ¶·¸¹º»¼½¾¿
91
-  //          °    ±    ³    ²    ?    µ    ¶    ·    ,    ¹    º    »    ¼    ½    ¾    ¿
92
-             0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,  // c38 ÀÁÃÄÅÆÇÈÉÊËÌÍÎÏ
93
-  //          À    Á    Â    Ã    Ä    Å    Æ    Ç    È    É    Ê    Ë    Ì    Í    Î    Ï
94
-             0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,  // c39 ÐÑÓÔÕÖרÙÚÛÜÝÞß
95
-  //          Ð    Ñ    Ò    Ó    Ô    Õ    Ö    ×    Ø    Ù    Ú    Û    Ü    Ý    Þ    ß
96
-             0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,  // c3a àáãäåæçèéêëìíîï
97
-  //          à    á    â    ã    ä    å    æ    ç    è    é    ê    ë    ì    í    î    ï
98
-             0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff   // c3b ðñóôõö÷øùúûüýþÿ
99
-  //          ð    ñ    ò    ó    ô    õ    ö    ÷    ø    ù    ú    û    ü    ý    þ    ÿ
88
+               0x20,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0x22,0xa9,0xaa,0xab,0x3f,0x3f,0xae,0x3f,  // c2a ¡¢£¤¥¦§¨©ª«¬­®¯
89
+             //' '   ¡    ¢    £    ¤    ¥    ¦    §    "    ©    ª    «    ?    ?    ®    ?
90
+               0xb0,0xb1,0xb2,0xb3,0x27,0xb5,0xb6,0xb7,0x2c,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,  // c2b °±²³´µ¶·¸¹º»¼½¾¿
91
+             // °    ±    ³    ²    ?    µ    ¶    ·    ,    ¹    º    »    ¼    ½    ¾    ¿
92
+               0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,  // c38 ÀÁÃÄÅÆÇÈÉÊËÌÍÎÏ
93
+             // À    Á    Â    Ã    Ä    Å    Æ    Ç    È    É    Ê    Ë    Ì    Í    Î    Ï
94
+               0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,  // c39 ÐÑÓÔÕÖרÙÚÛÜÝÞß
95
+             // Ð    Ñ    Ò    Ó    Ô    Õ    Ö    ×    Ø    Ù    Ú    Û    Ü    Ý    Þ    ß
96
+               0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,  // c3a àáãäåæçèéêëìíîï
97
+             // à    á    â    ã    ä    å    æ    ç    è    é    ê    ë    ì    í    î    ï
98
+               0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff   // c3b ðñóôõö÷øùúûüýþÿ
99
+             // ð    ñ    ò    ó    ô    õ    ö    ÷    ø    ù    ú    û    ü    ý    þ    ÿ
100 100
            };
101 101
     #elif ENABLED(MAPPER_D0D1)
102 102
       #define MAPPER_D0D1_MOD
103 103
       const PROGMEM uint8_t utf_recode[] =
104 104
            {//0    1    2    3    4    5    6    7    8    9    a    b    c    d    e    f
105
-             0x41,0x80,0x42,0x92,0x81,0x45,0x82,0x83,0x84,0x85,0x4b,0x86,0x4d,0x48,0x4f,0x87,  // d0a
106
-  //          A    Б    B    Г    Д    E    Ж    З    И    Й    K    Л    M    H    O    П
107
-             0x50,0x43,0x54,0x88,0xd8,0x58,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad,  // d0b
108
-  //          P    C    T    У    Ф    X    Ч    ч    Ш    Щ    Ъ    Ы    b    Э    Ю    Я
109
-             0x61,0x36,0x42,0x92,0x81,0x65,0x82,0xb3,0x84,0x85,0x6b,0x86,0x4d,0x48,0x6f,0x87,  // d18
110
-  //          a    6    B    Г    Д    e    Ж    ³    И    Й    k    Л    M    H    o    П
111
-             0x70,0x63,0x54,0x79,0xd8,0x78,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad   // d19
112
-  //          p    c    T    y    Ф    x    Ч    ч    Ш    Щ    Ъ    Ы    b    Э    Ю    Я
105
+               0x41,0x80,0x42,0x92,0x81,0x45,0x82,0x83,0x84,0x85,0x4b,0x86,0x4d,0x48,0x4f,0x87,  // d0a
106
+             // A    Б    B    Г    Д    E    Ж    З    И    Й    K    Л    M    H    O    П
107
+               0x50,0x43,0x54,0x88,0xd8,0x58,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad,  // d0b
108
+             // P    C    T    У    Ф    X    Ч    ч    Ш    Щ    Ъ    Ы    b    Э    Ю    Я
109
+               0x61,0x36,0x42,0x92,0x81,0x65,0x82,0xb3,0x84,0x85,0x6b,0x86,0x4d,0x48,0x6f,0x87,  // d18
110
+             // a    6    B    Г    Д    e    Ж    ³    И    Й    k    Л    M    H    o    П
111
+               0x70,0x63,0x54,0x79,0xd8,0x78,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x62,0x8f,0xac,0xad   // d19
112
+             // p    c    T    y    Ф    x    Ч    ч    Ш    Щ    Ъ    Ы    b    Э    Ю    Я
113 113
             };
114 114
     #elif ENABLED(MAPPER_E382E383)
115 115
       #error "Katakana on a WESTERN display makes no sense. There are no matching symbols."
@@ -121,23 +121,23 @@
121 121
       // it is a Russian alphabet translation
122 122
       // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
123 123
       const PROGMEM uint8_t utf_recode[] =
124
-             { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,   // unicode U+0400 to U+047f
125
-             // A   Б->Ё  B    Г    Д    E    Ж    З      // 0  Ѐ Ё Ђ Ѓ Є Ѕ І Ї
126
-               0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8,   //    Ј Љ Њ Ћ Ќ Ѝ Ў Џ
127
-             // И    Й    K    Л    M    H    O    П      // 1  А Б В Г Д Е Ж З
128
-               0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,   //    И Й К Л М Н О П
129
-             // P    C    T    У    Ф    X    Ч    ч      // 2  Р С Т У Ф Х Г Ч
130
-               0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,   //    Ш Щ Ъ Ы Ь Э Ю Я
131
-             // Ш    Щ    Ъ    Ы    b    Э    Ю    Я      // 3  а б в г д е ж з
132
-               0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,   //    и й к л м н о п
133
-             // a   б->ё  в    г    д    e    ж    з      // 4  р с т у ф х ц ч
134
-               0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe,   //    ш щ ъ ы ь э ю я
135
-             // и    й    к    л    м    н    o    п      // 5  ѐ ё ђ ѓ є ѕ і ї
136
-               0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,   //    ј љ њ ћ ќ ѝ ў џ
137
-             // p    c    т    y    ф    x    ц    ч      // 6  Ѡ ѡ Ѣ ѣ Ѥ ѥ Ѧ ѧ
138
-               0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7    //    Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ
139
-             // ш    щ    ъ    ы    ь    э    ю    я      // 7  Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ
140
-             };                                           //    ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ
124
+               { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,   // unicode U+0400 to U+047f
125
+               // A   Б->Ё  B    Г    Д    E    Ж    З      // 0  Ѐ Ё Ђ Ѓ Є Ѕ І Ї
126
+                 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8,   //    Ј Љ Њ Ћ Ќ Ѝ Ў Џ
127
+               // И    Й    K    Л    M    H    O    П      // 1  А Б В Г Д Е Ж З
128
+                 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,   //    И Й К Л М Н О П
129
+               // P    C    T    У    Ф    X    Ч    ч      // 2  Р С Т У Ф Х Г Ч
130
+                 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,   //    Ш Щ Ъ Ы Ь Э Ю Я
131
+               // Ш    Щ    Ъ    Ы    b    Э    Ю    Я      // 3  а б в г д е ж з
132
+                 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,   //    и й к л м н о п
133
+               // a   б->ё  в    г    д    e    ж    з      // 4  р с т у ф х ц ч
134
+                 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe,   //    ш щ ъ ы ь э ю я
135
+               // и    й    к    л    м    н    o    п      // 5  ѐ ё ђ ѓ є ѕ і ї
136
+                 0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,   //    ј љ њ ћ ќ ѝ ў џ
137
+               // p    c    т    y    ф    x    ц    ч      // 6  Ѡ ѡ Ѣ ѣ Ѥ ѥ Ѧ ѧ
138
+                 0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7    //    Ѫ ѩ Ѫ ѫ Ѭ ѭ Ѯ ѯ
139
+               // ш    щ    ъ    ы    ь    э    ю      я      // 7  Ѱ ѱ Ѳ ѳ Ѵ ѵ Ѷ ѷ
140
+             };                                             //    ѻ ѹ Ѻ ѻ Ѽ ѽ Ѿ ѿ
141 141
     #elif ENABLED(MAPPER_C2C3)
142 142
       #error "Western languages on a CYRILLIC display makes no sense. There are no matching symbols."
143 143
     #elif ENABLED(MAPPER_E382E383)
@@ -150,7 +150,7 @@
150 150
 
151 151
 #if ENABLED(MAPPER_C2C3)
152 152
 
153
-  char charset_mapper(char c) {
153
+  char charset_mapper(const char c) {
154 154
     static uint8_t utf_hi_char; // UTF-8 high part
155 155
     static bool seen_c2 = false;
156 156
     uint8_t d = c;
@@ -181,7 +181,7 @@
181 181
 
182 182
 #elif ENABLED(MAPPER_CECF)
183 183
 
184
-  char charset_mapper(char c) {
184
+  char charset_mapper(const char c) {
185 185
     static uint8_t utf_hi_char; // UTF-8 high part
186 186
     static bool seen_ce = false;
187 187
     uint8_t d = c;
@@ -212,7 +212,7 @@
212 212
 
213 213
 #elif ENABLED(MAPPER_CECF)
214 214
 
215
-  char charset_mapper(char c) {
215
+  char charset_mapper(const char c) {
216 216
     static uint8_t utf_hi_char; // UTF-8 high part
217 217
     static bool seen_ce = false;
218 218
     uint8_t d = c;
@@ -243,7 +243,7 @@
243 243
 
244 244
 #elif ENABLED(MAPPER_D0D1_MOD)
245 245
 
246
-  char charset_mapper(char c) {
246
+  char charset_mapper(const char c) {
247 247
     // it is a Russian alphabet translation
248 248
     // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
249 249
     static uint8_t utf_hi_char; // UTF-8 high part
@@ -280,7 +280,7 @@
280 280
 
281 281
 #elif ENABLED(MAPPER_D0D1)
282 282
 
283
-  char charset_mapper(char c) {
283
+  char charset_mapper(const char c) {
284 284
     static uint8_t utf_hi_char; // UTF-8 high part
285 285
     static bool seen_d5 = false;
286 286
     uint8_t d = c;
@@ -311,7 +311,7 @@
311 311
 
312 312
 #elif ENABLED(MAPPER_E382E383)
313 313
 
314
-  char charset_mapper(char c) {
314
+  char charset_mapper(const char c) {
315 315
     static uint8_t utf_hi_char; // UTF-8 high part
316 316
     static bool seen_e3 = false;
317 317
     static bool seen_82_83 = false;
@@ -350,7 +350,7 @@
350 350
 
351 351
   #define MAPPER_NON
352 352
 
353
-  char charset_mapper(char c) {
353
+  char charset_mapper(const char c) {
354 354
     HARDWARE_CHAR_OUT( c );
355 355
     return 1;
356 356
   }

正在加载...
取消
保存