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
 #ifdef NEWPANEL
987
 #ifdef NEWPANEL
988
     pinMode(BTN_EN1,INPUT);
988
     pinMode(BTN_EN1,INPUT);
989
     pinMode(BTN_EN2,INPUT);
989
     pinMode(BTN_EN2,INPUT);
990
-    pinMode(SDCARDDETECT,INPUT);
991
     WRITE(BTN_EN1,HIGH);
990
     WRITE(BTN_EN1,HIGH);
992
     WRITE(BTN_EN2,HIGH);
991
     WRITE(BTN_EN2,HIGH);
993
   #if BTN_ENC > 0
992
   #if BTN_ENC > 0
1001
     WRITE(SHIFT_OUT,HIGH);
1000
     WRITE(SHIFT_OUT,HIGH);
1002
     WRITE(SHIFT_LD,HIGH);
1001
     WRITE(SHIFT_LD,HIGH);
1003
   #endif
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
      pinMode (SR_DATA_PIN, OUTPUT);
1005
      pinMode (SR_DATA_PIN, OUTPUT);
1007
      pinMode (SR_CLK_PIN, OUTPUT);
1006
      pinMode (SR_CLK_PIN, OUTPUT);
1008
-  #else
1007
+  #elif defined(SHIFT_CLK) 
1009
      pinMode(SHIFT_CLK,OUTPUT);
1008
      pinMode(SHIFT_CLK,OUTPUT);
1010
      pinMode(SHIFT_LD,OUTPUT);
1009
      pinMode(SHIFT_LD,OUTPUT);
1011
      pinMode(SHIFT_EN,OUTPUT);
1010
      pinMode(SHIFT_EN,OUTPUT);
1013
      WRITE(SHIFT_OUT,HIGH);
1012
      WRITE(SHIFT_OUT,HIGH);
1014
      WRITE(SHIFT_LD,HIGH);
1013
      WRITE(SHIFT_LD,HIGH);
1015
      WRITE(SHIFT_EN,LOW);
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
 #endif//!NEWPANEL
1020
 #endif//!NEWPANEL
1018
 
1021
 
1019
-#if (SDCARDDETECT > 0)
1022
+#if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1023
+    pinMode(SDCARDDETECT,INPUT);
1020
     WRITE(SDCARDDETECT, HIGH);
1024
     WRITE(SDCARDDETECT, HIGH);
1021
     lcd_oldcardstatus = IS_SD_INSERTED;
1025
     lcd_oldcardstatus = IS_SD_INSERTED;
1022
 #endif//(SDCARDDETECT > 0)
1026
 #endif//(SDCARDDETECT > 0)
1023
-    #ifdef LCD_HAS_SLOW_BUTTONS
1027
+#ifdef LCD_HAS_SLOW_BUTTONS
1024
     slow_buttons = 0;
1028
     slow_buttons = 0;
1025
-    #endif
1029
+#endif
1026
     lcd_buttons_update();
1030
     lcd_buttons_update();
1027
 #ifdef ULTIPANEL
1031
 #ifdef ULTIPANEL
1028
     encoderDiff = 0;
1032
     encoderDiff = 0;

Loading…
Cancel
Save