From bcc04192fc046b766512cde5e5ec11958205ebc2 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Wed, 8 Apr 2015 12:56:38 +0200 Subject: [PATCH] Remove Contrast Menu for U8GLIB_ST7920 The other two devices we use in u8glib have more than only dummy code. Checked this in the library code. --- Marlin/Conditionals.h | 8 +++++++- Marlin/ultralcd.cpp | 16 +++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 5d3213e0e3..c7d2e793f1 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -130,7 +130,6 @@ #define NEWPANEL #endif - #ifdef ULTIPANEL #define NEWPANEL //enable this if you have a click-encoder panel #define SDSUPPORT @@ -161,6 +160,13 @@ #define DEFAULT_LCD_CONTRAST 32 #endif + #ifdef DOGLCD + #define HAS_LCD_CONTRAST + #ifdef U8GLIB_ST7920 + #undefine HAS_LCD_CONTRAST + #endif + #endif + #else // CONFIGURATION_LCD #define CONDITIONALS_H diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index caaf55ab74..9e90d564b3 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -58,7 +58,7 @@ static void lcd_status_screen(); static void lcd_control_temperature_preheat_abs_settings_menu(); static void lcd_control_motion_menu(); static void lcd_control_volumetric_menu(); - #ifdef DOGLCD + #ifdef HAS_LCD_CONTRAST static void lcd_set_contrast(); #endif #ifdef FWRETRACT @@ -739,7 +739,7 @@ static void lcd_control_menu() { MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); - #ifdef DOGLCD + #ifdef HAS_LCD_CONTRAST //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); #endif @@ -963,8 +963,7 @@ static void lcd_control_volumetric_menu() { END_MENU(); } -#ifdef DOGLCD - +#ifdef HAS_LCD_CONTRAST static void lcd_set_contrast() { if (encoderPosition != 0) { lcd_contrast -= encoderPosition; @@ -976,11 +975,9 @@ static void lcd_control_volumetric_menu() { if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast)); if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); } - -#endif // DOGLCD +#endif // HAS_LCD_CONTRAST #ifdef FWRETRACT - static void lcd_control_retract_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); @@ -998,16 +995,13 @@ static void lcd_control_volumetric_menu() { MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); END_MENU(); } - #endif // FWRETRACT #if SDCARDDETECT == -1 - static void lcd_sd_refresh() { card.initsd(); currentMenuViewOffset = 0; } - #endif static void lcd_sd_updir() { @@ -1458,7 +1452,7 @@ void lcd_setalertstatuspgm(const char* message) { void lcd_reset_alert_level() { lcd_status_message_level = 0; } -#ifdef DOGLCD +#ifdef HAS_LCD_CONTRAST void lcd_setcontrast(uint8_t value) { lcd_contrast = value & 0x3F; u8g.setContrast(lcd_contrast);