Browse Source

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.
AnHardt 10 years ago
parent
commit
bcc04192fc
2 changed files with 12 additions and 12 deletions
  1. 7
    1
      Marlin/Conditionals.h
  2. 5
    11
      Marlin/ultralcd.cpp

+ 7
- 1
Marlin/Conditionals.h View File

130
      #define NEWPANEL
130
      #define NEWPANEL
131
   #endif
131
   #endif
132
 
132
 
133
-
134
   #ifdef ULTIPANEL
133
   #ifdef ULTIPANEL
135
     #define NEWPANEL  //enable this if you have a click-encoder panel
134
     #define NEWPANEL  //enable this if you have a click-encoder panel
136
     #define SDSUPPORT
135
     #define SDSUPPORT
161
     #define DEFAULT_LCD_CONTRAST 32
160
     #define DEFAULT_LCD_CONTRAST 32
162
   #endif
161
   #endif
163
 
162
 
163
+  #ifdef DOGLCD
164
+    #define HAS_LCD_CONTRAST
165
+    #ifdef U8GLIB_ST7920
166
+      #undefine HAS_LCD_CONTRAST
167
+    #endif
168
+  #endif
169
+
164
 #else // CONFIGURATION_LCD
170
 #else // CONFIGURATION_LCD
165
 
171
 
166
   #define CONDITIONALS_H
172
   #define CONDITIONALS_H

+ 5
- 11
Marlin/ultralcd.cpp View File

58
   static void lcd_control_temperature_preheat_abs_settings_menu();
58
   static void lcd_control_temperature_preheat_abs_settings_menu();
59
   static void lcd_control_motion_menu();
59
   static void lcd_control_motion_menu();
60
   static void lcd_control_volumetric_menu();
60
   static void lcd_control_volumetric_menu();
61
-  #ifdef DOGLCD
61
+  #ifdef HAS_LCD_CONTRAST
62
     static void lcd_set_contrast();
62
     static void lcd_set_contrast();
63
   #endif
63
   #endif
64
   #ifdef FWRETRACT
64
   #ifdef FWRETRACT
739
   MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
739
   MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
740
   MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
740
   MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
741
 
741
 
742
-  #ifdef DOGLCD
742
+  #ifdef HAS_LCD_CONTRAST
743
     //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
743
     //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
744
     MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
744
     MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
745
   #endif
745
   #endif
963
   END_MENU();
963
   END_MENU();
964
 }
964
 }
965
 
965
 
966
-#ifdef DOGLCD
967
-
966
+#ifdef HAS_LCD_CONTRAST
968
   static void lcd_set_contrast() {
967
   static void lcd_set_contrast() {
969
     if (encoderPosition != 0) {
968
     if (encoderPosition != 0) {
970
       lcd_contrast -= encoderPosition;
969
       lcd_contrast -= encoderPosition;
976
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
975
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
977
     if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
976
     if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
978
   }
977
   }
979
-
980
-#endif // DOGLCD
978
+#endif // HAS_LCD_CONTRAST
981
 
979
 
982
 #ifdef FWRETRACT
980
 #ifdef FWRETRACT
983
-
984
   static void lcd_control_retract_menu() {
981
   static void lcd_control_retract_menu() {
985
     START_MENU();
982
     START_MENU();
986
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
983
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
998
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
995
     MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
999
     END_MENU();
996
     END_MENU();
1000
   }
997
   }
1001
-
1002
 #endif // FWRETRACT
998
 #endif // FWRETRACT
1003
 
999
 
1004
 #if SDCARDDETECT == -1
1000
 #if SDCARDDETECT == -1
1005
-
1006
   static void lcd_sd_refresh() {
1001
   static void lcd_sd_refresh() {
1007
     card.initsd();
1002
     card.initsd();
1008
     currentMenuViewOffset = 0;
1003
     currentMenuViewOffset = 0;
1009
   }
1004
   }
1010
-
1011
 #endif
1005
 #endif
1012
 
1006
 
1013
 static void lcd_sd_updir() {
1007
 static void lcd_sd_updir() {
1458
 
1452
 
1459
 void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1453
 void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1460
 
1454
 
1461
-#ifdef DOGLCD
1455
+#ifdef HAS_LCD_CONTRAST
1462
   void lcd_setcontrast(uint8_t value) {
1456
   void lcd_setcontrast(uint8_t value) {
1463
     lcd_contrast = value & 0x3F;
1457
     lcd_contrast = value & 0x3F;
1464
     u8g.setContrast(lcd_contrast);
1458
     u8g.setContrast(lcd_contrast);

Loading…
Cancel
Save