diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index d6fd4d004b3c..64d59a00bf55 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -381,30 +381,6 @@ #define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS)) #define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD) -/** - * Default LCD contrast for Graphical LCD displays - */ -#define HAS_LCD_CONTRAST ( \ - ENABLED(MAKRPANEL) \ - || ENABLED(CARTESIO_UI) \ - || ENABLED(VIKI2) \ - || ENABLED(AZSMZ_12864) \ - || ENABLED(FYSETC_MINI_12864) \ - || ENABLED(miniVIKI) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ -) -#if HAS_LCD_CONTRAST - #ifndef LCD_CONTRAST_MIN - #define LCD_CONTRAST_MIN 0 - #endif - #ifndef LCD_CONTRAST_MAX - #define LCD_CONTRAST_MAX 63 - #endif - #ifndef DEFAULT_LCD_CONTRAST - #define DEFAULT_LCD_CONTRAST 32 - #endif -#endif - /** * Extruders have some combination of stepper motors and hotends * so we separate these concepts into the defines: diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 937db9ee6a96..f040d885b7c0 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -246,6 +246,19 @@ #define MAX_AUTORETRACT 99 #endif +/** + * Default LCD contrast for Graphical LCD displays + */ +#define HAS_LCD_CONTRAST defined(DEFAULT_LCD_CONTRAST) +#if HAS_LCD_CONTRAST + #ifndef LCD_CONTRAST_MIN + #define LCD_CONTRAST_MIN 0 + #endif + #ifndef LCD_CONTRAST_MAX + #define LCD_CONTRAST_MAX MAX(63, DEFAULT_LCD_CONTRAST) + #endif +#endif + /** * Override here because this is set in Configuration_adv.h */ diff --git a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h index 92ec285f5275..c1711212512f 100644 --- a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h +++ b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h @@ -105,8 +105,6 @@ #define BTN_ENC 5 // This display has adjustable contrast - #undef HAS_LCD_CONTRAST - #define HAS_LCD_CONTRAST 1 #define LCD_CONTRAST_MIN 0 #define LCD_CONTRAST_MAX 255 #define DEFAULT_LCD_CONTRAST 255 diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index b639d0b25a85..4e747a20b785 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -436,7 +436,7 @@ #define DOGLCD_CS 25 // GLCD features - //#define LCD_CONTRAST 190 + //#define DEFAULT_LCD_CONTRAST 190 // Uncomment screen orientation //#define LCD_SCREEN_ROT_90 //#define LCD_SCREEN_ROT_180 @@ -463,7 +463,7 @@ #define DOGLCD_CS 66 // GLCD features - //#define LCD_CONTRAST 190 + //#define DEFAULT_LCD_CONTRAST 190 // Uncomment screen orientation //#define LCD_SCREEN_ROT_90 //#define LCD_SCREEN_ROT_180 diff --git a/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h index aad45bd1ea14..366e92049647 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h @@ -137,7 +137,7 @@ #define DOGLCD_CS PB7 #endif - //#define LCD_CONTRAST 190 + //#define DEFAULT_LCD_CONTRAST 190 //#define LCD_SCREEN_ROT_90 //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 diff --git a/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h index ffde10f02479..5fe0fa430b66 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h @@ -140,7 +140,7 @@ #define RGB_LED_B_PIN PB6 #endif - //#define LCD_CONTRAST 190 + //#define DEFAULT_LCD_CONTRAST 190 #if ENABLED(NEWPANEL) #define BTN_EN1 PC11