浏览代码

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 9 年前
父节点
当前提交
bcc04192fc
共有 2 个文件被更改,包括 12 次插入12 次删除
  1. 7
    1
      Marlin/Conditionals.h
  2. 5
    11
      Marlin/ultralcd.cpp

+ 7
- 1
Marlin/Conditionals.h 查看文件

@@ -130,7 +130,6 @@
130 130
      #define NEWPANEL
131 131
   #endif
132 132
 
133
-
134 133
   #ifdef ULTIPANEL
135 134
     #define NEWPANEL  //enable this if you have a click-encoder panel
136 135
     #define SDSUPPORT
@@ -161,6 +160,13 @@
161 160
     #define DEFAULT_LCD_CONTRAST 32
162 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 170
 #else // CONFIGURATION_LCD
165 171
 
166 172
   #define CONDITIONALS_H

+ 5
- 11
Marlin/ultralcd.cpp 查看文件

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

正在加载...
取消
保存