Browse Source

Apply #elif in LCD conditionals

Scott Lahteine 8 years ago
parent
commit
6c45fa7dcc
1 changed files with 42 additions and 37 deletions
  1. 42
    37
      Marlin/Conditionals_LCD.h

+ 42
- 37
Marlin/Conditionals_LCD.h View File

@@ -31,22 +31,28 @@
31 31
   #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
32 32
 
33 33
   #if ENABLED(CARTESIO_UI)
34
+
34 35
     #define DOGLCD
35 36
     #define ULTIPANEL
36 37
     #define NEWPANEL
37 38
     #define DEFAULT_LCD_CONTRAST 90
38 39
     #define LCD_CONTRAST_MIN 60
39 40
     #define LCD_CONTRAST_MAX 140
40
-  #endif
41 41
 
42
-  #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
42
+  #elif ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
43
+
43 44
     #define DOGLCD
44 45
     #define ULTIPANEL
45 46
     #define NEWPANEL
46 47
     #define DEFAULT_LCD_CONTRAST 17
47
-  #endif
48 48
 
49
-  #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
49
+  #elif ENABLED(BQ_LCD_SMART_CONTROLLER)
50
+
51
+    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
52
+    #define LONG_FILENAME_HOST_SUPPORT
53
+
54
+  #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
55
+
50 56
     #define ULTRA_LCD  //general LCD support, also 16x2
51 57
     #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
52 58
     #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
@@ -65,14 +71,28 @@
65 71
       #define SD_DETECT_INVERTED
66 72
     #endif
67 73
 
68
-  #endif
74
+  #elif ENABLED(OLED_PANEL_TINYBOY2)
69 75
 
70
-  #if ENABLED(OLED_PANEL_TINYBOY2)
71 76
     #define U8GLIB_SSD1306
72 77
     #define ULTIPANEL
73 78
     #define NEWPANEL
74 79
     #define REVERSE_ENCODER_DIRECTION
75 80
     #define REVERSE_MENU_DIRECTION
81
+
82
+  #elif ENABLED(RA_CONTROL_PANEL)
83
+
84
+    #define LCD_I2C_TYPE_PCA8574
85
+    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
86
+    #define ULTIPANEL
87
+    #define NEWPANEL
88
+
89
+  #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
90
+
91
+    #define DOGLCD
92
+    #define U8GLIB_ST7920
93
+    #define ULTIPANEL
94
+    #define NEWPANEL
95
+
76 96
   #endif
77 97
 
78 98
   // Generic support for SSD1306 / SH1106 OLED based LCDs.
@@ -85,13 +105,6 @@
85 105
     #define ULTIMAKERCONTROLLER
86 106
   #endif
87 107
 
88
-  #if ENABLED(BQ_LCD_SMART_CONTROLLER)
89
-    #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
90
-    #ifndef LONG_FILENAME_HOST_SUPPORT
91
-      #define LONG_FILENAME_HOST_SUPPORT
92
-    #endif
93
-  #endif
94
-
95 108
   #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
96 109
     #define DOGLCD
97 110
     #define U8GLIB_ST7920
@@ -113,48 +126,40 @@
113 126
     #endif
114 127
   #endif
115 128
 
116
-  #if ENABLED(RA_CONTROL_PANEL)
117
-    #define LCD_I2C_TYPE_PCA8574
118
-    #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
119
-    #define ULTIPANEL
120
-    #define NEWPANEL
121
-  #endif
122
-
123
-  #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
124
-    #define DOGLCD
125
-    #define U8GLIB_ST7920
126
-    #define ULTIPANEL
127
-    #define NEWPANEL
128
-  #endif
129
-
130 129
   /**
131 130
    * I2C PANELS
132 131
    */
133 132
 
134 133
   #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
134
+
135 135
     // Note: This controller requires F.Malpartida's LiquidCrystal_I2C library
136 136
     // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
137
+
137 138
     #define LCD_I2C_TYPE_PCF8575
138 139
     #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
139 140
     #define ULTIPANEL
140 141
     #define NEWPANEL
141
-  #endif
142 142
 
143
-  // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
144
-  #if ENABLED(LCD_I2C_PANELOLU2)
143
+  #elif ENABLED(LCD_I2C_PANELOLU2)
144
+
145
+    // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
146
+
145 147
     #define LCD_I2C_TYPE_MCP23017
146 148
     #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
147 149
     #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
148 150
     #define ULTIPANEL
149 151
     #define NEWPANEL
150
-  #endif
151 152
 
152
-  // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
153
-  #if ENABLED(LCD_I2C_VIKI)
154
-    // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
155
-    // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
156
-    // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
157
-    //       BTN_ENC pin (or set BTN_ENC to -1 if not used)
153
+  #elif ENABLED(LCD_I2C_VIKI)
154
+
155
+    /**
156
+     * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
157
+     *
158
+     * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
159
+     * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
160
+     * Note: The pause/stop/resume LCD button pin should be connected to the Arduino
161
+     *       BTN_ENC pin (or set BTN_ENC to -1 if not used)
162
+     */
158 163
     #define LCD_I2C_TYPE_MCP23017
159 164
     #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
160 165
     #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)

Loading…
Cancel
Save