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
 extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
10
 extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11
 #else
11
 #else
12
 extern volatile uint16_t buttons;  //an extended version of the last checked buttons in a bit array.
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
 #endif
13
 #endif
22
 
14
 
23
 ////////////////////////////////////
15
 ////////////////////////////////////
188
   #include <LiquidTWI2.h>
180
   #include <LiquidTWI2.h>
189
   #define LCD_CLASS LiquidTWI2
181
   #define LCD_CLASS LiquidTWI2
190
   LCD_CLASS lcd(LCD_I2C_ADDRESS);  
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
 #else
189
 #else
193
   // Standard directly connected LCD implementations
190
   // Standard directly connected LCD implementations
212
 #define LCD_STR_CLOCK       "\x07"
209
 #define LCD_STR_CLOCK       "\x07"
213
 #define LCD_STR_ARROW_RIGHT "\x7E"  /* from the default character set */
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
 static void lcd_implementation_init()
212
 static void lcd_implementation_init()
222
 {
213
 {
223
     byte bedTemp[8] =
214
     byte bedTemp[8] =
303
         B00000,
294
         B00000,
304
         B00000
295
         B00000
305
     }; //thanks Sonny Mounicou
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
     lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
300
     lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
315
     lcd.setBacklight(HIGH);
301
     lcd.setBacklight(HIGH);
316
   #endif
302
   #endif
323
 #elif defined(LCD_I2C_TYPE_MCP23008)
309
 #elif defined(LCD_I2C_TYPE_MCP23008)
324
     lcd.setMCPType(LTI_TYPE_MCP23008);
310
     lcd.setMCPType(LTI_TYPE_MCP23008);
325
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
311
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
312
+
313
+#elif defined(LCD_I2C_TYPE_PCA8574)
314
+      lcd.init();
315
+      lcd.backlight();
326
     
316
     
327
 #else
317
 #else
328
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
318
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);

Loading…
Cancel
Save