瀏覽代碼

Added a light-weight status screen for the ST7920

- The status screen uses the ST7920 character generator to greatly
  reduce SPI traffic and MCU load when updating the status screen.

- Has been tested with the RepRapDiscount Full Graphics Smart Controller
  but should work with any LCD that uses an ST7920 or fully compatible
  controller.
Marcio Teixeira 7 年之前
父節點
當前提交
4880ac6533
共有 24 個文件被更改,包括 288 次插入18 次删除
  1. 11
    0
      Marlin/Configuration.h
  2. 11
    0
      Marlin/src/config/default/Configuration.h
  3. 11
    0
      Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
  4. 10
    1
      Marlin/src/config/examples/Anet/A6/Configuration.h
  5. 13
    0
      Marlin/src/config/examples/Anet/A8/Configuration.h
  6. 11
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h
  7. 11
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h
  8. 11
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h
  9. 11
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
  10. 11
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration.h
  11. 12
    0
      Marlin/src/config/examples/RigidBot/Configuration.h
  12. 11
    0
      Marlin/src/config/examples/STM32F10/Configuration.h
  13. 11
    0
      Marlin/src/config/examples/Sanguinololu/Configuration.h
  14. 11
    0
      Marlin/src/config/examples/Tronxy/X1/Configuration.h
  15. 11
    0
      Marlin/src/config/examples/Tronxy/X5S/Configuration.h
  16. 11
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration.h
  17. 11
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration.h
  18. 11
    0
      Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
  19. 11
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration.h
  20. 11
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h
  21. 11
    0
      Marlin/src/config/examples/makibox/Configuration.h
  22. 13
    3
      Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp
  23. 32
    14
      Marlin/src/lcd/ultralcd.cpp
  24. 10
    0
      Marlin/src/lcd/ultralcd_impl_DOGM.h

+ 11
- 0
Marlin/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/default/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/AliExpress/CL-260/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 10
- 1
Marlin/src/config/examples/Anet/A6/Configuration.h 查看文件

@@ -1658,9 +1658,18 @@
1658 1658
 // RepRapDiscount FULL GRAPHIC Smart Controller
1659 1659
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1660 1660
 //
1661
-// Note: Details on connecting to the Anet V1.0 controller are in the file pins_ANET_10.h
1661
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1662
+// light-weight status screen will be used that takes advantage of
1663
+// the ST7920 character-generator to conserve MCU resources.
1662 1664
 //
1665
+// Since the lightweight status screen can only show a status
1666
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1667
+// to the number of seconds until the position is revealed after a new
1668
+// status message is drawn.
1669
+
1663 1670
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1671
+//#define USE_ST7920_LIGHTWEIGHT_UI
1672
+//#define DELAY_TO_SHOW_POSITION 20
1664 1673
 
1665 1674
 //
1666 1675
 // MakerLab Mini Panel with graphic

+ 13
- 0
Marlin/src/config/examples/Anet/A8/Configuration.h 查看文件

@@ -1513,6 +1513,7 @@
1513 1513
 //
1514 1514
 //#define G3D_PANEL
1515 1515
 
1516
+
1516 1517
 //
1517 1518
 // RepRapDiscount FULL GRAPHIC Smart Controller
1518 1519
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
@@ -1521,6 +1522,18 @@
1521 1522
 //
1522 1523
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523 1524
 
1525
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1526
+// light-weight status screen will be used that takes advantage of
1527
+// the ST7920 character-generator to conserve MCU resources.
1528
+//
1529
+// Since the lightweight status screen can only show a status
1530
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1531
+// to the number of seconds until the position is revealed after a new
1532
+// status message is drawn.
1533
+
1534
+//#define USE_ST7920_LIGHTWEIGHT_UI
1535
+//#define DELAY_TO_SHOW_POSITION 20
1536
+
1524 1537
 //
1525 1538
 // MakerLab Mini Panel with graphic
1526 1539
 // controller and SD support - http://reprap.org/wiki/Mini_panel

+ 11
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h 查看文件

@@ -1516,7 +1516,18 @@
1516 1516
 // RepRapDiscount FULL GRAPHIC Smart Controller
1517 1517
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1518 1518
 //
1519
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1520
+// light-weight status screen will be used that takes advantage of
1521
+// the ST7920 character-generator to conserve MCU resources.
1522
+//
1523
+// Since the lightweight status screen can only show a status
1524
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1525
+// to the number of seconds until the position is revealed after a new
1526
+// status message is drawn.
1527
+
1519 1528
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1529
+//#define USE_ST7920_LIGHTWEIGHT_UI
1530
+//#define DELAY_TO_SHOW_POSITION 20
1520 1531
 
1521 1532
 //
1522 1533
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration.h 查看文件

@@ -1514,7 +1514,18 @@
1514 1514
 // RepRapDiscount FULL GRAPHIC Smart Controller
1515 1515
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1516 1516
 //
1517
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1518
+// light-weight status screen will be used that takes advantage of
1519
+// the ST7920 character-generator to conserve MCU resources.
1520
+//
1521
+// Since the lightweight status screen can only show a status
1522
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1523
+// to the number of seconds until the position is revealed after a new
1524
+// status message is drawn.
1525
+
1517 1526
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1527
+//#define USE_ST7920_LIGHTWEIGHT_UI
1528
+//#define DELAY_TO_SHOW_POSITION 20
1518 1529
 
1519 1530
 //
1520 1531
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration.h 查看文件

@@ -1521,7 +1521,18 @@
1521 1521
 // RepRapDiscount FULL GRAPHIC Smart Controller
1522 1522
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1523 1523
 //
1524
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1525
+// light-weight status screen will be used that takes advantage of
1526
+// the ST7920 character-generator to conserve MCU resources.
1527
+//
1528
+// Since the lightweight status screen can only show a status
1529
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1530
+// to the number of seconds until the position is revealed after a new
1531
+// status message is drawn.
1532
+
1524 1533
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1534
+//#define USE_ST7920_LIGHTWEIGHT_UI
1535
+//#define DELAY_TO_SHOW_POSITION 20
1525 1536
 
1526 1537
 //
1527 1538
 // MakerLab Mini Panel with graphic

+ 12
- 0
Marlin/src/config/examples/RigidBot/Configuration.h 查看文件

@@ -1512,6 +1512,18 @@
1512 1512
 //
1513 1513
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1514 1514
 
1515
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1516
+// light-weight status screen will be used that takes advantage of
1517
+// the ST7920 character-generator to conserve MCU resources.
1518
+//
1519
+// Since the lightweight status screen can only show a status
1520
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1521
+// to the number of seconds until the position is revealed after a new
1522
+// status message is drawn.
1523
+
1524
+//#define USE_ST7920_LIGHTWEIGHT_UI
1525
+//#define DELAY_TO_SHOW_POSITION 20
1526
+
1515 1527
 //
1516 1528
 // MakerLab Mini Panel with graphic
1517 1529
 // controller and SD support - http://reprap.org/wiki/Mini_panel

+ 11
- 0
Marlin/src/config/examples/STM32F10/Configuration.h 查看文件

@@ -1513,7 +1513,18 @@
1513 1513
 // RepRapDiscount FULL GRAPHIC Smart Controller
1514 1514
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1515 1515
 //
1516
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1517
+// light-weight status screen will be used that takes advantage of
1518
+// the ST7920 character-generator to conserve MCU resources.
1519
+//
1520
+// Since the lightweight status screen can only show a status
1521
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1522
+// to the number of seconds until the position is revealed after a new
1523
+// status message is drawn.
1524
+
1516 1525
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1526
+//#define USE_ST7920_LIGHTWEIGHT_UI
1527
+//#define DELAY_TO_SHOW_POSITION 20
1517 1528
 
1518 1529
 //
1519 1530
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Sanguinololu/Configuration.h 查看文件

@@ -1541,7 +1541,18 @@
1541 1541
 // RepRapDiscount FULL GRAPHIC Smart Controller
1542 1542
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1543 1543
 //
1544
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1545
+// light-weight status screen will be used that takes advantage of
1546
+// the ST7920 character-generator to conserve MCU resources.
1547
+//
1548
+// Since the lightweight status screen can only show a status
1549
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1550
+// to the number of seconds until the position is revealed after a new
1551
+// status message is drawn.
1552
+
1544 1553
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1554
+//#define USE_ST7920_LIGHTWEIGHT_UI
1555
+//#define DELAY_TO_SHOW_POSITION 20
1545 1556
 
1546 1557
 //
1547 1558
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Tronxy/X1/Configuration.h 查看文件

@@ -1495,7 +1495,18 @@
1495 1495
 // RepRapDiscount FULL GRAPHIC Smart Controller
1496 1496
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1497 1497
 //
1498
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1499
+// light-weight status screen will be used that takes advantage of
1500
+// the ST7920 character-generator to conserve MCU resources.
1501
+//
1502
+// Since the lightweight status screen can only show a status
1503
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1504
+// to the number of seconds until the position is revealed after a new
1505
+// status message is drawn.
1506
+
1498 1507
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1508
+//#define USE_ST7920_LIGHTWEIGHT_UI
1509
+//#define DELAY_TO_SHOW_POSITION 20
1499 1510
 
1500 1511
 //
1501 1512
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Tronxy/X5S/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration.h 查看文件

@@ -1543,7 +1543,18 @@
1543 1543
 // RepRapDiscount FULL GRAPHIC Smart Controller
1544 1544
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1545 1545
 //
1546
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1547
+// light-weight status screen will be used that takes advantage of
1548
+// the ST7920 character-generator to conserve MCU resources.
1549
+//
1550
+// Since the lightweight status screen can only show a status
1551
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1552
+// to the number of seconds until the position is revealed after a new
1553
+// status message is drawn.
1554
+
1546 1555
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1556
+//#define USE_ST7920_LIGHTWEIGHT_UI
1557
+//#define DELAY_TO_SHOW_POSITION 20
1547 1558
 
1548 1559
 //
1549 1560
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration.h 查看文件

@@ -1510,7 +1510,18 @@
1510 1510
 // RepRapDiscount FULL GRAPHIC Smart Controller
1511 1511
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1512 1512
 //
1513
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1514
+// light-weight status screen will be used that takes advantage of
1515
+// the ST7920 character-generator to conserve MCU resources.
1516
+//
1517
+// Since the lightweight status screen can only show a status
1518
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1519
+// to the number of seconds until the position is revealed after a new
1520
+// status message is drawn.
1521
+
1513 1522
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1523
+//#define USE_ST7920_LIGHTWEIGHT_UI
1524
+//#define DELAY_TO_SHOW_POSITION 20
1514 1525
 
1515 1526
 //
1516 1527
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h 查看文件

@@ -1504,7 +1504,18 @@
1504 1504
 // RepRapDiscount FULL GRAPHIC Smart Controller
1505 1505
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1506 1506
 //
1507
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1508
+// light-weight status screen will be used that takes advantage of
1509
+// the ST7920 character-generator to conserve MCU resources.
1510
+//
1511
+// Since the lightweight status screen can only show a status
1512
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1513
+// to the number of seconds until the position is revealed after a new
1514
+// status message is drawn.
1515
+
1507 1516
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1517
+//#define USE_ST7920_LIGHTWEIGHT_UI
1518
+//#define DELAY_TO_SHOW_POSITION 20
1508 1519
 
1509 1520
 //
1510 1521
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration.h 查看文件

@@ -1634,7 +1634,18 @@
1634 1634
 // RepRapDiscount FULL GRAPHIC Smart Controller
1635 1635
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1636 1636
 //
1637
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1638
+// light-weight status screen will be used that takes advantage of
1639
+// the ST7920 character-generator to conserve MCU resources.
1640
+//
1641
+// Since the lightweight status screen can only show a status
1642
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1643
+// to the number of seconds until the position is revealed after a new
1644
+// status message is drawn.
1645
+
1637 1646
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1647
+//#define USE_ST7920_LIGHTWEIGHT_UI
1648
+//#define DELAY_TO_SHOW_POSITION 20
1638 1649
 
1639 1650
 //
1640 1651
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h 查看文件

@@ -1524,7 +1524,18 @@
1524 1524
 // RepRapDiscount FULL GRAPHIC Smart Controller
1525 1525
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1526 1526
 //
1527
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1528
+// light-weight status screen will be used that takes advantage of
1529
+// the ST7920 character-generator to conserve MCU resources.
1530
+//
1531
+// Since the lightweight status screen can only show a status
1532
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1533
+// to the number of seconds until the position is revealed after a new
1534
+// status message is drawn.
1535
+
1527 1536
 #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1537
+//#define USE_ST7920_LIGHTWEIGHT_UI
1538
+//#define DELAY_TO_SHOW_POSITION 20
1528 1539
 
1529 1540
 //
1530 1541
 // MakerLab Mini Panel with graphic

+ 11
- 0
Marlin/src/config/examples/makibox/Configuration.h 查看文件

@@ -1513,7 +1513,18 @@
1513 1513
 // RepRapDiscount FULL GRAPHIC Smart Controller
1514 1514
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1515 1515
 //
1516
+// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
1517
+// light-weight status screen will be used that takes advantage of
1518
+// the ST7920 character-generator to conserve MCU resources.
1519
+//
1520
+// Since the lightweight status screen can only show a status
1521
+// message or the position, but not both, set DELAY_TO_SHOW_POSITION
1522
+// to the number of seconds until the position is revealed after a new
1523
+// status message is drawn.
1524
+
1516 1525
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1526
+//#define USE_ST7920_LIGHTWEIGHT_UI
1527
+//#define DELAY_TO_SHOW_POSITION 20
1517 1528
 
1518 1529
 //
1519 1530
 // MakerLab Mini Panel with graphic

+ 13
- 3
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp 查看文件

@@ -119,10 +119,12 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
119 119
       ST7920_CS();
120 120
       u8g_Delay(120);                 //initial delay for boot up
121 121
       ST7920_SET_CMD();
122
+      ST7920_WRITE_NIBBLES(0x20);       //non-extended mode
122 123
       ST7920_WRITE_NIBBLES(0x08);       //display off, cursor+blink off
123
-      ST7920_WRITE_NIBBLES(0x01);       //clear CGRAM ram
124
-      u8g_Delay(15);                 //delay for CGRAM clear
125
-      ST7920_WRITE_NIBBLES(0x3E);       //extended mode + GDRAM active
124
+      ST7920_WRITE_NIBBLES(0x01);       //clear DDRAM ram
125
+      u8g_Delay(15);                    //delay for DDRAM clear
126
+      ST7920_WRITE_NIBBLES(0x24);       //extended mode
127
+      ST7920_WRITE_NIBBLES(0x26);       //extended mode + GDRAM active
126 128
       for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM
127 129
         ST7920_WRITE_NIBBLES(0x80 | y); //set y
128 130
         ST7920_WRITE_NIBBLES(0x80);     //set x = 0
@@ -178,6 +180,14 @@ uint8_t   u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U
178 180
 u8g_pb_t  u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf};
179 181
 u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn};
180 182
 
183
+#if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
184
+  typedef const __FlashStringHelper *progmem_str;
185
+
186
+  // We have to include the code for the lightweight UI here
187
+  // as it relies on macros that are only defined in this file.
188
+  #include "ultralcd_impl_st7920_lite_status_screen_impl_spi.h"
189
+#endif
190
+
181 191
 #pragma GCC reset_options
182 192
 
183 193
 #endif // U8G_HAL_LINKS

+ 32
- 14
Marlin/src/lcd/ultralcd.cpp 查看文件

@@ -5113,20 +5113,38 @@ void lcd_update() {
5113 5113
       #endif
5114 5114
 
5115 5115
       #if ENABLED(DOGLCD)
5116
-        if (!drawing_screen) {                        // If not already drawing pages
5117
-          u8g.firstPage();                            // Start the first page
5118
-          drawing_screen = 1;                         // Flag as drawing pages
5119
-        }
5120
-        lcd_setFont(FONT_MENU);                       // Setup font for every page draw
5121
-        u8g.setColorIndex(1);                         // And reset the color
5122
-        CURRENTSCREEN();                              // Draw and process the current screen
5123
-
5124
-        // The screen handler can clear drawing_screen for an action that changes the screen.
5125
-        // If still drawing and there's another page, update max-time and return now.
5126
-        // The nextPage will already be set up on the next call.
5127
-        if (drawing_screen && (drawing_screen = u8g.nextPage())) {
5128
-          NOLESS(max_display_update_time, millis() - ms);
5129
-          return;
5116
+        #if defined(USE_ST7920_LIGHTWEIGHT_UI)
5117
+          #if ENABLED(ULTIPANEL)
5118
+            bool do_U8G_loop = true;
5119
+            lcd_in_status(currentScreen == lcd_status_screen);
5120
+            if(currentScreen == lcd_status_screen) {
5121
+              lcd_status_screen();
5122
+              do_U8G_loop = false;
5123
+            }
5124
+          #else
5125
+            const bool do_U8G_loop = false;
5126
+            lcd_in_status(true);
5127
+            lcd_status_screen();
5128
+          #endif
5129
+        #else
5130
+          const bool do_U8G_loop = true;
5131
+        #endif
5132
+        if(do_U8G_loop) {
5133
+          if (!drawing_screen) {                        // If not already drawing pages
5134
+            u8g.firstPage();                            // Start the first page
5135
+            drawing_screen = 1;                         // Flag as drawing pages
5136
+          }
5137
+          lcd_setFont(FONT_MENU);                       // Setup font for every page draw
5138
+          u8g.setColorIndex(1);                         // And reset the color
5139
+          CURRENTSCREEN();                              // Draw and process the current screen
5140
+
5141
+          // The screen handler can clear drawing_screen for an action that changes the screen.
5142
+          // If still drawing and there's another page, update max-time and return now.
5143
+          // The nextPage will already be set up on the next call.
5144
+          if (drawing_screen && (drawing_screen = u8g.nextPage())) {
5145
+            NOLESS(max_display_update_time, millis() - ms);
5146
+            return;
5147
+          }
5130 5148
         }
5131 5149
       #else
5132 5150
         CURRENTSCREEN();

+ 10
- 0
Marlin/src/lcd/ultralcd_impl_DOGM.h 查看文件

@@ -54,6 +54,11 @@
54 54
 
55 55
 #include "dogm/dogm_bitmaps.h"
56 56
 
57
+#if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
58
+  typedef const __FlashStringHelper *progmem_str;
59
+  #include "dogm/ultralcd_impl_st7920_lite_status_screen_impl.h"
60
+#endif
61
+
57 62
 #if ENABLED(SDSUPPORT)
58 63
   #include "../libs/duration_t.h"
59 64
 #endif
@@ -373,6 +378,9 @@ static void lcd_implementation_init() {
373 378
 
374 379
 // The kill screen is displayed for unrecoverable conditions
375 380
 void lcd_kill_screen() {
381
+  #if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
382
+    ST7920_Lite_Status_Screen::clear_text_buffer();
383
+  #endif
376 384
   const uint8_t h4 = u8g.getHeight() / 4;
377 385
   u8g.firstPage();
378 386
   do {
@@ -498,6 +506,7 @@ inline void lcd_implementation_status_message(const bool blink) {
498 506
   #endif
499 507
 }
500 508
 
509
+#if !ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
501 510
 static void lcd_implementation_status_screen() {
502 511
 
503 512
   const bool blink = lcd_blink();
@@ -803,6 +812,7 @@ static void lcd_implementation_status_screen() {
803 812
     #endif
804 813
   }
805 814
 }
815
+#endif
806 816
 
807 817
 #if ENABLED(ULTIPANEL)
808 818
 

Loading…
取消
儲存