Skip to content

Commit

Permalink
DEFAULT_LCD_CONTRAST => LCD_CONTRAST_DEFAULT
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 20, 2022
1 parent d88a840 commit 9bd8e61
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/gcode/lcd/M250.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* M250: Read and optionally set the LCD contrast
*/
void GcodeSuite::M250() {
if (parser.seenval('C'))
if (LCD_CONTRAST_MIN < LCD_CONTRAST_MAX && parser.seenval('C'))
ui.set_contrast(parser.value_byte());
else
M250_report();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
#define LCD_HEIGHT 10 // Character lines
#define LCD_CONTRAST_MIN 127
#define LCD_CONTRAST_MAX 255
#define DEFAULT_LCD_CONTRAST 250
#define LCD_CONTRAST_DEFAULT 250
#define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table.
// At this time present conversion only for cyrillic - bg, ru and uk languages.
// First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@
#define LCD_CONTRAST_MAX 63 // ST7567 6-bits contrast
#endif
#endif
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST LCD_CONTRAST_INIT
#ifndef LCD_CONTRAST_DEFAULT
#define LCD_CONTRAST_DEFAULT LCD_CONTRAST_INIT
#endif
#endif

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,7 @@
#if CANNOT_EMBED_CONFIGURATION
#warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
#endif

#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX
#warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX."
#endif
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ void menu_configuration() {
#if HAS_LCD_BRIGHTNESS
EDIT_ITEM_FAST(uint8, MSG_BRIGHTNESS, &ui.brightness, LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.refresh_brightness, true);
#endif
#if HAS_LCD_CONTRAST
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN < LCD_CONTRAST_MAX
EDIT_ITEM_FAST(uint8, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true);
#endif
#if ENABLED(FWRETRACT)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3019,7 +3019,7 @@ void MarlinSettings::reset() {
//
// LCD Contrast
//
TERN_(HAS_LCD_CONTRAST, ui.set_contrast(DEFAULT_LCD_CONTRAST));
TERN_(HAS_LCD_CONTRAST, ui.set_contrast(LCD_CONTRAST_DEFAULT));

//
// LCD Brightness
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_GT2560_REV_A.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

#define LCD_RESET_PIN 16

#define DEFAULT_LCD_CONTRAST 220
#define LCD_CONTRAST_DEFAULT 220

#define LCD_BACKLIGHT_PIN -1
#else
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_HJC2560C_REV2.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#if ENABLED(HJC_LCD_SMART_CONTROLLER)
#define LCD_BACKLIGHT_PIN 5 // LCD_Backlight
//#ifndef LCD_CONTRAST_PIN
// #define LCD_CONTRAST_PIN 5 // LCD_Contrast
// #define LCD_CONTRAST_PIN 5 // LCD_Contrast
//#endif
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 24 // Filament runout
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_K8800.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

#define LCD_CONTRAST_MIN 0
#define LCD_CONTRAST_MAX 100
#define DEFAULT_LCD_CONTRAST 30
#define LCD_CONTRAST_DEFAULT 30
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270

#if IS_NEWPANEL
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
#define NEOPIXEL_PIN PB9
#endif

#define DEFAULT_LCD_CONTRAST 255
#define LCD_CONTRAST_DEFAULT 255
#else
#define LCD_PINS_RS PC15
#define LCD_PINS_ENABLE PB6
Expand Down

0 comments on commit 9bd8e61

Please sign in to comment.