Browse Source

Enable basic ULTRA_LCD screen w/o encoders and menus.

David Forrest 11 years ago
parent
commit
61a7256d42
1 changed files with 12 additions and 8 deletions
  1. 12
    8
      Marlin/ultralcd.cpp

+ 12
- 8
Marlin/ultralcd.cpp View File

@@ -987,7 +987,6 @@ void lcd_init()
987 987
 #ifdef NEWPANEL
988 988
     pinMode(BTN_EN1,INPUT);
989 989
     pinMode(BTN_EN2,INPUT);
990
-    pinMode(SDCARDDETECT,INPUT);
991 990
     WRITE(BTN_EN1,HIGH);
992 991
     WRITE(BTN_EN2,HIGH);
993 992
   #if BTN_ENC > 0
@@ -1001,11 +1000,11 @@ void lcd_init()
1001 1000
     WRITE(SHIFT_OUT,HIGH);
1002 1001
     WRITE(SHIFT_LD,HIGH);
1003 1002
   #endif
1004
-#else
1005
-  #ifdef SR_LCD_2W_NL
1003
+#else  // Not NEWPANEL
1004
+  #ifdef SR_LCD_2W_NL // Non latching 2 wire shiftregister
1006 1005
      pinMode (SR_DATA_PIN, OUTPUT);
1007 1006
      pinMode (SR_CLK_PIN, OUTPUT);
1008
-  #else
1007
+  #elif defined(SHIFT_CLK) 
1009 1008
      pinMode(SHIFT_CLK,OUTPUT);
1010 1009
      pinMode(SHIFT_LD,OUTPUT);
1011 1010
      pinMode(SHIFT_EN,OUTPUT);
@@ -1013,16 +1012,21 @@ void lcd_init()
1013 1012
      WRITE(SHIFT_OUT,HIGH);
1014 1013
      WRITE(SHIFT_LD,HIGH);
1015 1014
      WRITE(SHIFT_EN,LOW);
1016
-   #endif // SR_LCD_2W_NL
1015
+  #else
1016
+     #ifdef ULTIPANEL
1017
+     #error ULTIPANEL requires an encoder
1018
+     #endif
1019
+  #endif // SR_LCD_2W_NL
1017 1020
 #endif//!NEWPANEL
1018 1021
 
1019
-#if (SDCARDDETECT > 0)
1022
+#if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1023
+    pinMode(SDCARDDETECT,INPUT);
1020 1024
     WRITE(SDCARDDETECT, HIGH);
1021 1025
     lcd_oldcardstatus = IS_SD_INSERTED;
1022 1026
 #endif//(SDCARDDETECT > 0)
1023
-    #ifdef LCD_HAS_SLOW_BUTTONS
1027
+#ifdef LCD_HAS_SLOW_BUTTONS
1024 1028
     slow_buttons = 0;
1025
-    #endif
1029
+#endif
1026 1030
     lcd_buttons_update();
1027 1031
 #ifdef ULTIPANEL
1028 1032
     encoderDiff = 0;

Loading…
Cancel
Save