Browse Source

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.
pull/1/head
Marcio Teixeira 7 years ago
parent
commit
4880ac6533
  1. 11
      Marlin/Configuration.h
  2. 11
      Marlin/src/config/default/Configuration.h
  3. 11
      Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
  4. 11
      Marlin/src/config/examples/Anet/A6/Configuration.h
  5. 13
      Marlin/src/config/examples/Anet/A8/Configuration.h
  6. 11
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h
  7. 11
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h
  8. 11
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h
  9. 11
      Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
  10. 11
      Marlin/src/config/examples/JGAurora/A5/Configuration.h
  11. 12
      Marlin/src/config/examples/RigidBot/Configuration.h
  12. 11
      Marlin/src/config/examples/STM32F10/Configuration.h
  13. 11
      Marlin/src/config/examples/Sanguinololu/Configuration.h
  14. 11
      Marlin/src/config/examples/Tronxy/X1/Configuration.h
  15. 11
      Marlin/src/config/examples/Tronxy/X5S/Configuration.h
  16. 11
      Marlin/src/config/examples/Velleman/K8200/Configuration.h
  17. 11
      Marlin/src/config/examples/Velleman/K8400/Configuration.h
  18. 11
      Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
  19. 11
      Marlin/src/config/examples/delta/kossel_mini/Configuration.h
  20. 11
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h
  21. 11
      Marlin/src/config/examples/makibox/Configuration.h
  22. 16
      Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp
  23. 18
      Marlin/src/lcd/ultralcd.cpp
  24. 10
      Marlin/src/lcd/ultralcd_impl_DOGM.h

11
Marlin/Configuration.h

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

11
Marlin/src/config/default/Configuration.h

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

11
Marlin/src/config/examples/AliExpress/CL-260/Configuration.h

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

11
Marlin/src/config/examples/Anet/A6/Configuration.h

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

13
Marlin/src/config/examples/Anet/A8/Configuration.h

@ -1513,6 +1513,7 @@
// //
//#define G3D_PANEL //#define G3D_PANEL
// //
// RepRapDiscount FULL GRAPHIC Smart Controller // RepRapDiscount FULL GRAPHIC Smart Controller
// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
@ -1521,6 +1522,18 @@
// //
//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
// light-weight status screen will be used that takes advantage of
// the ST7920 character-generator to conserve MCU resources.
//
// Since the lightweight status screen can only show a status
// message or the position, but not both, set DELAY_TO_SHOW_POSITION
// to the number of seconds until the position is revealed after a new
// status message is drawn.
//#define USE_ST7920_LIGHTWEIGHT_UI
//#define DELAY_TO_SHOW_POSITION 20
// //
// MakerLab Mini Panel with graphic // MakerLab Mini Panel with graphic
// controller and SD support - http://reprap.org/wiki/Mini_panel // controller and SD support - http://reprap.org/wiki/Mini_panel

11
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
// RepRapDiscount FULL GRAPHIC Smart Controller // RepRapDiscount FULL GRAPHIC Smart Controller
// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
// //
// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
// light-weight status screen will be used that takes advantage of
// the ST7920 character-generator to conserve MCU resources.
//
// Since the lightweight status screen can only show a status
// message or the position, but not both, set DELAY_TO_SHOW_POSITION
// to the number of seconds until the position is revealed after a new
// status message is drawn.
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
//#define USE_ST7920_LIGHTWEIGHT_UI
//#define DELAY_TO_SHOW_POSITION 20
// //
// MakerLab Mini Panel with graphic // MakerLab Mini Panel with graphic

11
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
// RepRapDiscount FULL GRAPHIC Smart Controller // RepRapDiscount FULL GRAPHIC Smart Controller
// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
// //
// If USE_ST7920_LIGHTWEIGHT_UI is uncommented, then an alternative
// light-weight status screen will be used that takes advantage of
// the ST7920 character-generator to conserve MCU resources.
//
// Since the lightweight status screen can only show a status
// message or the position, but not both, set DELAY_TO_SHOW_POSITION
// to the number of seconds until the position is revealed after a new
// status message is drawn.
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
//#define USE_ST7920_LIGHTWEIGHT_UI
//#define DELAY_TO_SHOW_POSITION 20
// //
// MakerLab Mini Panel with graphic // MakerLab Mini Panel with graphic

11
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h

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

11
Marlin/src/config/examples/Infitary/i3-M508/Configuration.h

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

11
Marlin/src/config/examples/JGAurora/A5/Configuration.h

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

12
Marlin/src/config/examples/RigidBot/Configuration.h

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

11
Marlin/src/config/examples/STM32F10/Configuration.h

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

11
Marlin/src/config/examples/Sanguinololu/Configuration.h

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

11
Marlin/src/config/examples/Tronxy/X1/Configuration.h

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

11
Marlin/src/config/examples/Tronxy/X5S/Configuration.h

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

11
Marlin/src/config/examples/Velleman/K8200/Configuration.h

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

11
Marlin/src/config/examples/Velleman/K8400/Configuration.h

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

11
Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h

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

11
Marlin/src/config/examples/delta/kossel_mini/Configuration.h

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

11
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h

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

11
Marlin/src/config/examples/makibox/Configuration.h

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

16
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
ST7920_CS(); ST7920_CS();
u8g_Delay(120); //initial delay for boot up u8g_Delay(120); //initial delay for boot up
ST7920_SET_CMD(); ST7920_SET_CMD();
ST7920_WRITE_NIBBLES(0x20); //non-extended mode
ST7920_WRITE_NIBBLES(0x08); //display off, cursor+blink off ST7920_WRITE_NIBBLES(0x08); //display off, cursor+blink off
ST7920_WRITE_NIBBLES(0x01); //clear CGRAM ram ST7920_WRITE_NIBBLES(0x01); //clear DDRAM ram
u8g_Delay(15); //delay for CGRAM clear u8g_Delay(15); //delay for DDRAM clear
ST7920_WRITE_NIBBLES(0x3E); //extended mode + GDRAM active ST7920_WRITE_NIBBLES(0x24); //extended mode
ST7920_WRITE_NIBBLES(0x26); //extended mode + GDRAM active
for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM for (y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM
ST7920_WRITE_NIBBLES(0x80 | y); //set y ST7920_WRITE_NIBBLES(0x80 | y); //set y
ST7920_WRITE_NIBBLES(0x80); //set x = 0 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
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}; 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};
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}; 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};
#if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
typedef const __FlashStringHelper *progmem_str;
// We have to include the code for the lightweight UI here
// as it relies on macros that are only defined in this file.
#include "ultralcd_impl_st7920_lite_status_screen_impl_spi.h"
#endif
#pragma GCC reset_options #pragma GCC reset_options
#endif // U8G_HAL_LINKS #endif // U8G_HAL_LINKS

18
Marlin/src/lcd/ultralcd.cpp

@ -5113,6 +5113,23 @@ void lcd_update() {
#endif #endif
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
#if defined(USE_ST7920_LIGHTWEIGHT_UI)
#if ENABLED(ULTIPANEL)
bool do_U8G_loop = true;
lcd_in_status(currentScreen == lcd_status_screen);
if(currentScreen == lcd_status_screen) {
lcd_status_screen();
do_U8G_loop = false;
}
#else
const bool do_U8G_loop = false;
lcd_in_status(true);
lcd_status_screen();
#endif
#else
const bool do_U8G_loop = true;
#endif
if(do_U8G_loop) {
if (!drawing_screen) { // If not already drawing pages if (!drawing_screen) { // If not already drawing pages
u8g.firstPage(); // Start the first page u8g.firstPage(); // Start the first page
drawing_screen = 1; // Flag as drawing pages drawing_screen = 1; // Flag as drawing pages
@ -5128,6 +5145,7 @@ void lcd_update() {
NOLESS(max_display_update_time, millis() - ms); NOLESS(max_display_update_time, millis() - ms);
return; return;
} }
}
#else #else
CURRENTSCREEN(); CURRENTSCREEN();
#endif #endif

10
Marlin/src/lcd/ultralcd_impl_DOGM.h

@ -54,6 +54,11 @@
#include "dogm/dogm_bitmaps.h" #include "dogm/dogm_bitmaps.h"
#if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
typedef const __FlashStringHelper *progmem_str;
#include "dogm/ultralcd_impl_st7920_lite_status_screen_impl.h"
#endif
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "../libs/duration_t.h" #include "../libs/duration_t.h"
#endif #endif
@ -373,6 +378,9 @@ static void lcd_implementation_init() {
// The kill screen is displayed for unrecoverable conditions // The kill screen is displayed for unrecoverable conditions
void lcd_kill_screen() { void lcd_kill_screen() {
#if ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
ST7920_Lite_Status_Screen::clear_text_buffer();
#endif
const uint8_t h4 = u8g.getHeight() / 4; const uint8_t h4 = u8g.getHeight() / 4;
u8g.firstPage(); u8g.firstPage();
do { do {
@ -498,6 +506,7 @@ inline void lcd_implementation_status_message(const bool blink) {
#endif #endif
} }
#if !ENABLED(USE_ST7920_LIGHTWEIGHT_UI)
static void lcd_implementation_status_screen() { static void lcd_implementation_status_screen() {
const bool blink = lcd_blink(); const bool blink = lcd_blink();
@ -803,6 +812,7 @@ static void lcd_implementation_status_screen() {
#endif #endif
} }
} }
#endif
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

Loading…
Cancel
Save