From 4393c3ef7fe1a5d7c3aeeb40095e26eb518fb2bc Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Thu, 11 Jan 2018 18:32:41 -0600 Subject: [PATCH] LCD_CONTRAST to uint16_t for 1.1.x parity (#9148) --- Marlin/configuration_store.cpp | 6 +++--- Marlin/ultralcd.cpp | 2 +- Marlin/ultralcd.h | 4 ++-- Marlin/ultralcd_impl_DOGM.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index be3796053..72f6d313f 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -189,7 +189,7 @@ typedef struct SettingsDataStruct { // // HAS_LCD_CONTRAST // - uint16_t lcd_contrast; // M250 C + int16_t lcd_contrast; // M250 C // // FWRETRACT @@ -618,7 +618,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(lcd_contrast); #if !HAS_LCD_CONTRAST - const uint16_t lcd_contrast = 32; + const int16_t lcd_contrast = 32; #endif EEPROM_WRITE(lcd_contrast); @@ -1159,7 +1159,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(lcd_contrast); #if !HAS_LCD_CONTRAST - uint16_t lcd_contrast; + int16_t lcd_contrast; #endif EEPROM_READ(lcd_contrast); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 23722e44d..da8fb9abd 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -5236,7 +5236,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } #if HAS_LCD_CONTRAST - void set_lcd_contrast(const uint16_t value) { + void set_lcd_contrast(const int16_t value) { lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); u8g.setContrast(lcd_contrast); } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 523db3fad..5ce7cf366 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -71,8 +71,8 @@ #endif #if ENABLED(DOGLCD) - extern uint16_t lcd_contrast; - void set_lcd_contrast(const uint16_t value); + extern int16_t lcd_contrast; + void set_lcd_contrast(const int16_t value); #endif #if ENABLED(SHOW_BOOTSCREEN) diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 201dbbdbc..1791392b8 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -222,7 +222,7 @@ #include "utf_mapper.h" -uint16_t lcd_contrast; // Initialized by settings.load() +int16_t lcd_contrast; // Initialized by settings.load() static char currentfont = 0; // The current graphical page being rendered