Encapsulate common display code in a singleton (#12395)

* Encapsulate common LCD code in a singleton
* Depend more UBL code on UBL_DEVEL_DEBUGGING
  - Since most users don't need the debugging on at all times, this helps reduce the default build size for UBL by over 2K, a little closer to fitting on 128K boards.
This commit is contained in:
Scott Lahteine
2018-11-11 12:16:24 -06:00
committed by GitHub
parent 9da6809ac3
commit a0c795b097
65 changed files with 1881 additions and 1997 deletions

View File

@ -1628,3 +1628,39 @@
#else
#define Z_STEPPER_COUNT 1
#endif
// Get LCD character width/height, which may be overridden by pins, configs, etc.
#if HAS_GRAPHICAL_LCD
#ifndef LCD_WIDTH
#ifdef LCD_WIDTH_OVERRIDE
#define LCD_WIDTH LCD_WIDTH_OVERRIDE
#elif ENABLED(LIGHTWEIGHT_UI)
#define LCD_WIDTH 16
#else
#define LCD_WIDTH 22
#endif
#endif
#ifndef LCD_HEIGHT
#ifdef LCD_HEIGHT_OVERRIDE
#define LCD_HEIGHT LCD_HEIGHT_OVERRIDE
#elif ENABLED(LIGHTWEIGHT_UI)
#define LCD_HEIGHT 4
#else
#define LCD_HEIGHT 5
#endif
#endif
#elif ENABLED(ULTIPANEL)
#ifndef LCD_WIDTH
#define LCD_WIDTH 20
#endif
#ifndef LCD_HEIGHT
#define LCD_HEIGHT 4
#endif
#elif HAS_SPI_LCD
#ifndef LCD_WIDTH
#define LCD_WIDTH 16
#endif
#ifndef LCD_HEIGHT
#define LCD_HEIGHT 2
#endif
#endif