Procházet zdrojové kódy

Allow use of either SD Card slot when LCD Panel is configured.

Preference is for Controller SD slot before LCD Panel slot when both are occupied.
Neil Darlow před 11 roky
rodič
revize
89f78b0b80
2 změnil soubory, kde provedl 13 přidání a 5 odebrání
  1. 10
    2
      Marlin/cardreader.cpp
  2. 3
    3
      Marlin/pins.h

+ 10
- 2
Marlin/cardreader.cpp Zobrazit soubor

@@ -150,9 +150,17 @@ void CardReader::initsd()
150 150
   if(root.isOpen())
151 151
     root.close();
152 152
 #ifdef SDSLOW
153
-  if (!card.init(SPI_HALF_SPEED,SDSS))
153
+  if (!card.init(SPI_HALF_SPEED,SDSS)
154
+  #if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
155
+    && !card.init(SPI_HALF_SPEED,LCD_SDSS)
156
+  #endif
157
+    )
154 158
 #else
155
-  if (!card.init(SPI_FULL_SPEED,SDSS))
159
+  if (!card.init(SPI_FULL_SPEED,SDSS)
160
+  #if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
161
+    && !card.init(SPI_FULL_SPEED,LCD_SDSS)
162
+  #endif
163
+    )
156 164
 #endif
157 165
   {
158 166
     //if (!card.init(SPI_HALF_SPEED,SDSS))

+ 3
- 3
Marlin/pins.h Zobrazit soubor

@@ -614,14 +614,14 @@
614 614
         #define BTN_EN1 47  //reverse if the encoder turns the wrong way.
615 615
         #define BTN_EN2 43
616 616
         #define BTN_ENC 32
617
-        #define SDSS 53
617
+        #define LCD_SDSS 53
618 618
         #define SDCARDDETECT -1
619 619
         #define KILL_PIN 41
620 620
       #elif defined(LCD_I2C_VIKI)
621 621
         #define BTN_EN1 22  //reverse if the encoder turns the wrong way.
622 622
         #define BTN_EN2 7
623 623
         #define BTN_ENC -1
624
-        #define SDSS 53
624
+        #define LCD_SDSS 53
625 625
         #define SDCARDDETECT 49
626 626
       #else
627 627
         //arduino pin which triggers an piezzo beeper
@@ -1123,7 +1123,7 @@
1123 1123
      #ifdef LCD_I2C_PANELOLU2
1124 1124
        #ifdef MELZI
1125 1125
          #define BTN_ENC 29 //the click switch
1126
-         #define SDSS 30 //to use the SD card reader on the Panelolu2 rather than the melzi board
1126
+         #define LCD_SDSS 30 //to use the SD card reader on the Panelolu2 rather than the melzi board
1127 1127
        #else
1128 1128
          #define BTN_ENC 30 //the click switch
1129 1129
        #endif

Loading…
Zrušit
Uložit