Repository navigation
Conversation
|
I've always wanted to do something along these lines, or at least separate LCD configuration options into a third configuration file. But then we may as well start breaking up configurations into dozens of files based on feature. The main caveat with this change is that it removes documentation for displays from One might say, well we already have to look outside to find the correct name for the To support this change Since this change is so impactful to configurations it probably ought to be deferred until after the upcoming release. |
6e9a213 to
a2d5667
Compare
Description
Selects the display with a single option, the way
MOTHERBOARDselects the board:Configuration.hcurrently lists about 100 display options, each to be uncommented on its own. They move to a newMarlin/src/core/displays.h, which works likeboards.h: one numberedLCD_*value per display, each keeping the description it had inConfiguration.h.Configuration.hkeeps only the selector and the settings that belong to particular displays.Configuration.hships//#define LCD_CONTROLLER LCD_NONE; left undefined, it defaults toLCD_NONE.How it works
displays.his included besideboards.h, ahead ofConfiguration.h.Conditionals-2-LCD.h, the selected value is mapped back to the existing option name (LCD_VIKI2→#define VIKI2). Nothing downstream changes. An unknown value is an#error.LCD_DGUS_ORIGIN…LCD_DGUS_E3S1PRO), which setDGUS_LCD_UI.Display settings in
Configuration.hConfiguration.his read before the selection is mapped, so a block like#if ENABLED(TFT_GENERIC)in it would be skipped for a display chosen withLCD_CONTROLLER.displays.haddsLCD_IS(NAME), true whenNAMEis either enabled by name or selected, and these blocks now use it:MIGHTYBOARD_LCD, DGUS (MKS,IA_CREALITY),ANYCUBIC_LCD_I3MEGA,EXTENSIBLE_UI,TFT_GENERIC,DWIN_CREALITY_LCD.Options chosen alongside a display stay separate:
TFT_CLASSIC_UI/TFT_COLOR_UI/TFT_LVGL_UI,TFT_ROTATION,TOUCH_SCREEN,REPRAPWORLD_KEYPAD,EASYTHREED_UI.SAV_3DGLCDSAV_3DGLCDneeded a second option for its OLED controller. It becomes two displays,SAV_3DGLCD_SSD1306andSAV_3DGLCD_SH1106(LCD_SAV_3DGLCD_SSD1306/LCD_SAV_3DGLCD_SH1106), which setSAV_3DGLCDand the matchingU8GLIB_*driver. Its options block is removed fromConfiguration.h, and the sanity check for a missing or doubled driver now names the two new values.Compatibility
Existing configurations are unaffected:
#define VIKI2) and settingDGUS_LCD_UIstill work.SAV_3DGLCDwithU8GLIB_SSD1306orU8GLIB_SH1106still works.Tooling
opt_enable <display>/opt_disable <display>: the names are no longer inConfiguration.h, so a display name now sets or clearsLCD_CONTROLLER. Other unknown names are still errors.opt_set DGUS_LCD_UI ...and test.inifiles that name a display keep working, since both add options that aren't present.schema.pyoffers theLCD_*values as choices forLCD_CONTROLLER, as it does forMOTHERBOARD.Fix
EMOTION_TECH_LCDwas missing from the "only one LCD controller" count, so it could be combined with another display without an error. It's now counted and selectable.Requirements
None.
Benefits
A display is chosen by setting one option to a name from a list, instead of finding and uncommenting the right line among about 100. Display-specific settings sit together in
Configuration.h.Configurations
The example configurations enable displays by name and keep building, but their LCD sections no longer match the new default layout. Before the next import,
import-2.1.xneeds its examples converted toLCD_CONTROLLER. The tooling that propagates default-config changes into the examples and builds thebugfix/ release branches also needs to handle the new LCD section. The documentation for choosing a display (currently "uncomment the line for your display") needs updating to match.Testing
mega2560): identical binary tobugfix-2.1.xapart from the embedded build time.bugfix-2.1.x, by name on this branch, and withLCD_CONTROLLER: identical binaries apart from the build time. Tested for RRD Full Graphic,SAV_3DGLCDSSD1306 and SH1106,TFT_GENERIC(LERDGE-K, FSMC, Color UI) and DGUS MKS.LCD_CONTROLLERvalue, and two different displays, each fail with a clear error.mega2560,STM32F103RE_creality,mks_robin_pro2,LERDGEKandmega2560ext(29 configurations) pass, including a newmega2560/config-11.inithat selectsLCD_SAV_3DGLCD_SH1106.Related Issues
None.