Browse Source

Merge pull request #721 from drf5n/lcdOnly

Enable basic ULTRA_LCD screen w/o encoders and menus.
ErikZalm 11 years ago
parent
commit
84df13f7d1
1 changed files with 12 additions and 8 deletions
  1. 12
    8
      Marlin/ultralcd.cpp

+ 12
- 8
Marlin/ultralcd.cpp View File

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

Loading…
Cancel
Save