Browse Source

Merge pull request #1866 from AnHardt/contrast

Remove Contrast Menu for device U8GLIB_ST7920
Scott Lahteine 9 years ago
parent
commit
4abd23ae9e
3 changed files with 16 additions and 16 deletions
  1. 7
    1
      Marlin/Conditionals.h
  2. 4
    4
      Marlin/Marlin_main.cpp
  3. 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
+      #undef 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

+ 4
- 4
Marlin/Marlin_main.cpp View File

4083
 
4083
 
4084
 #endif // CHDK || PHOTOGRAPH_PIN
4084
 #endif // CHDK || PHOTOGRAPH_PIN
4085
 
4085
 
4086
-#ifdef DOGLCD
4086
+#ifdef HAS_LCD_CONTRAST
4087
 
4087
 
4088
   /**
4088
   /**
4089
    * M250: Read and optionally set the LCD contrast
4089
    * M250: Read and optionally set the LCD contrast
4095
     SERIAL_EOL;
4095
     SERIAL_EOL;
4096
   }
4096
   }
4097
 
4097
 
4098
-#endif // DOGLCD
4098
+#endif // HAS_LCD_CONTRAST
4099
 
4099
 
4100
 #ifdef PREVENT_DANGEROUS_EXTRUDE
4100
 #ifdef PREVENT_DANGEROUS_EXTRUDE
4101
 
4101
 
5081
           break;
5081
           break;
5082
       #endif // CHDK || PHOTOGRAPH_PIN
5082
       #endif // CHDK || PHOTOGRAPH_PIN
5083
 
5083
 
5084
-      #ifdef DOGLCD
5084
+      #ifdef HAS_LCD_CONTRAST
5085
         case 250: // M250  Set LCD contrast value: C<value> (value 0..63)
5085
         case 250: // M250  Set LCD contrast value: C<value> (value 0..63)
5086
           gcode_M250();
5086
           gcode_M250();
5087
           break;
5087
           break;
5088
-      #endif // DOGLCD
5088
+      #endif // HAS_LCD_CONTRAST
5089
 
5089
 
5090
       #ifdef PREVENT_DANGEROUS_EXTRUDE
5090
       #ifdef PREVENT_DANGEROUS_EXTRUDE
5091
         case 302: // allow cold extrudes, or set the minimum extrude temperature
5091
         case 302: // allow cold extrudes, or set the minimum extrude temperature

+ 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