Merge pull request #1866 from AnHardt/contrast

Remove Contrast Menu for device U8GLIB_ST7920
This commit is contained in:
Scott Lahteine 2015-04-09 00:34:25 -07:00
commit 4abd23ae9e
3 changed files with 16 additions and 16 deletions

View File

@ -130,7 +130,6 @@
#define NEWPANEL #define NEWPANEL
#endif #endif
#ifdef ULTIPANEL #ifdef ULTIPANEL
#define NEWPANEL //enable this if you have a click-encoder panel #define NEWPANEL //enable this if you have a click-encoder panel
#define SDSUPPORT #define SDSUPPORT
@ -161,6 +160,13 @@
#define DEFAULT_LCD_CONTRAST 32 #define DEFAULT_LCD_CONTRAST 32
#endif #endif
#ifdef DOGLCD
#define HAS_LCD_CONTRAST
#ifdef U8GLIB_ST7920
#undef HAS_LCD_CONTRAST
#endif
#endif
#else // CONFIGURATION_LCD #else // CONFIGURATION_LCD
#define CONDITIONALS_H #define CONDITIONALS_H

View File

@ -4083,7 +4083,7 @@ inline void gcode_M226() {
#endif // CHDK || PHOTOGRAPH_PIN #endif // CHDK || PHOTOGRAPH_PIN
#ifdef DOGLCD #ifdef HAS_LCD_CONTRAST
/** /**
* M250: Read and optionally set the LCD contrast * M250: Read and optionally set the LCD contrast
@ -4095,7 +4095,7 @@ inline void gcode_M226() {
SERIAL_EOL; SERIAL_EOL;
} }
#endif // DOGLCD #endif // HAS_LCD_CONTRAST
#ifdef PREVENT_DANGEROUS_EXTRUDE #ifdef PREVENT_DANGEROUS_EXTRUDE
@ -5081,11 +5081,11 @@ void process_commands() {
break; break;
#endif // CHDK || PHOTOGRAPH_PIN #endif // CHDK || PHOTOGRAPH_PIN
#ifdef DOGLCD #ifdef HAS_LCD_CONTRAST
case 250: // M250 Set LCD contrast value: C<value> (value 0..63) case 250: // M250 Set LCD contrast value: C<value> (value 0..63)
gcode_M250(); gcode_M250();
break; break;
#endif // DOGLCD #endif // HAS_LCD_CONTRAST
#ifdef PREVENT_DANGEROUS_EXTRUDE #ifdef PREVENT_DANGEROUS_EXTRUDE
case 302: // allow cold extrudes, or set the minimum extrude temperature case 302: // allow cold extrudes, or set the minimum extrude temperature

View File

@ -58,7 +58,7 @@ static void lcd_status_screen();
static void lcd_control_temperature_preheat_abs_settings_menu(); static void lcd_control_temperature_preheat_abs_settings_menu();
static void lcd_control_motion_menu(); static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu(); static void lcd_control_volumetric_menu();
#ifdef DOGLCD #ifdef HAS_LCD_CONTRAST
static void lcd_set_contrast(); static void lcd_set_contrast();
#endif #endif
#ifdef FWRETRACT #ifdef FWRETRACT
@ -739,7 +739,7 @@ static void lcd_control_menu() {
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_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_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif #endif
@ -963,8 +963,7 @@ static void lcd_control_volumetric_menu() {
END_MENU(); END_MENU();
} }
#ifdef DOGLCD #ifdef HAS_LCD_CONTRAST
static void lcd_set_contrast() { static void lcd_set_contrast() {
if (encoderPosition != 0) { if (encoderPosition != 0) {
lcd_contrast -= encoderPosition; 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 (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
} }
#endif // HAS_LCD_CONTRAST
#endif // DOGLCD
#ifdef FWRETRACT #ifdef FWRETRACT
static void lcd_control_retract_menu() { static void lcd_control_retract_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_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); MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
END_MENU(); END_MENU();
} }
#endif // FWRETRACT #endif // FWRETRACT
#if SDCARDDETECT == -1 #if SDCARDDETECT == -1
static void lcd_sd_refresh() { static void lcd_sd_refresh() {
card.initsd(); card.initsd();
currentMenuViewOffset = 0; currentMenuViewOffset = 0;
} }
#endif #endif
static void lcd_sd_updir() { 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; } void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#ifdef DOGLCD #ifdef HAS_LCD_CONTRAST
void lcd_setcontrast(uint8_t value) { void lcd_setcontrast(uint8_t value) {
lcd_contrast = value & 0x3F; lcd_contrast = value & 0x3F;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);