Browse Source

Fixed small error in lcd define statements.

kiyoshigawa 12 years ago
parent
commit
69b02031ca
1 changed files with 12 additions and 22 deletions
  1. 12
    22
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 12
- 22
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -10,14 +10,6 @@
10 10
 extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11 11
 #else
12 12
 extern volatile uint16_t buttons;  //an extended version of the last checked buttons in a bit array.
13
-
14
-  #ifdef  LCD_I2C_TYPE_PCA8574
15
-    #include <LiquidCrystal_I2C.h>
16
-    #define LCD_CLASS LiquidCrystal_I2C
17
-  #else
18
-    #include <LiquidCrystal.h>
19
-    #define LCD_CLASS LiquidCrystal
20
-  #endif
21 13
 #endif
22 14
 
23 15
 ////////////////////////////////////
@@ -188,6 +180,11 @@ extern volatile uint16_t buttons;  //an extended version of the last checked but
188 180
   #include <LiquidTWI2.h>
189 181
   #define LCD_CLASS LiquidTWI2
190 182
   LCD_CLASS lcd(LCD_I2C_ADDRESS);  
183
+
184
+#elif defined(LCD_I2C_TYPE_PCA8574)
185
+    #include <LiquidCrystal_I2C.h>
186
+    #define LCD_CLASS LiquidCrystal_I2C
187
+	LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
191 188
   
192 189
 #else
193 190
   // Standard directly connected LCD implementations
@@ -212,12 +209,6 @@ extern volatile uint16_t buttons;  //an extended version of the last checked but
212 209
 #define LCD_STR_CLOCK       "\x07"
213 210
 #define LCD_STR_ARROW_RIGHT "\x7E"  /* from the default character set */
214 211
 
215
-#ifdef LCD_I2C_TYPE_PCA8574
216
-  LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
217
-#else
218
-  LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7);  //RS,Enable,D4,D5,D6,D7
219
-#endif
220
-
221 212
 static void lcd_implementation_init()
222 213
 {
223 214
     byte bedTemp[8] =
@@ -303,14 +294,9 @@ static void lcd_implementation_init()
303 294
         B00000,
304 295
         B00000
305 296
     }; //thanks Sonny Mounicou
306
-    #ifdef LCD_I2C_TYPE_PCA8574
307
-      lcd.init();
308
-      lcd.backlight();
309
-    #else
310
-	  if defined(LCDI2C_TYPE_PCF8575)
311
-        lcd.begin(LCD_WIDTH, LCD_HEIGHT);
312
-    #endif
313
-  #ifdef LCD_I2C_PIN_BL
297
+#if defined(LCDI2C_TYPE_PCF8575)
298
+    lcd.begin(LCD_WIDTH, LCD_HEIGHT);
299
+   #ifdef LCD_I2C_PIN_BL
314 300
     lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
315 301
     lcd.setBacklight(HIGH);
316 302
   #endif
@@ -323,6 +309,10 @@ static void lcd_implementation_init()
323 309
 #elif defined(LCD_I2C_TYPE_MCP23008)
324 310
     lcd.setMCPType(LTI_TYPE_MCP23008);
325 311
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
312
+
313
+#elif defined(LCD_I2C_TYPE_PCA8574)
314
+      lcd.init();
315
+      lcd.backlight();
326 316
     
327 317
 #else
328 318
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);

Loading…
Cancel
Save