Quellcode durchsuchen

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 vor 11 Jahren
Ursprung
Commit
89f78b0b80
2 geänderte Dateien mit 13 neuen und 5 gelöschten Zeilen
  1. 10
    2
      Marlin/cardreader.cpp
  2. 3
    3
      Marlin/pins.h

+ 10
- 2
Marlin/cardreader.cpp Datei anzeigen

150
   if(root.isOpen())
150
   if(root.isOpen())
151
     root.close();
151
     root.close();
152
 #ifdef SDSLOW
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
 #else
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
 #endif
164
 #endif
157
   {
165
   {
158
     //if (!card.init(SPI_HALF_SPEED,SDSS))
166
     //if (!card.init(SPI_HALF_SPEED,SDSS))

+ 3
- 3
Marlin/pins.h Datei anzeigen

614
         #define BTN_EN1 47  //reverse if the encoder turns the wrong way.
614
         #define BTN_EN1 47  //reverse if the encoder turns the wrong way.
615
         #define BTN_EN2 43
615
         #define BTN_EN2 43
616
         #define BTN_ENC 32
616
         #define BTN_ENC 32
617
-        #define SDSS 53
617
+        #define LCD_SDSS 53
618
         #define SDCARDDETECT -1
618
         #define SDCARDDETECT -1
619
         #define KILL_PIN 41
619
         #define KILL_PIN 41
620
       #elif defined(LCD_I2C_VIKI)
620
       #elif defined(LCD_I2C_VIKI)
621
         #define BTN_EN1 22  //reverse if the encoder turns the wrong way.
621
         #define BTN_EN1 22  //reverse if the encoder turns the wrong way.
622
         #define BTN_EN2 7
622
         #define BTN_EN2 7
623
         #define BTN_ENC -1
623
         #define BTN_ENC -1
624
-        #define SDSS 53
624
+        #define LCD_SDSS 53
625
         #define SDCARDDETECT 49
625
         #define SDCARDDETECT 49
626
       #else
626
       #else
627
         //arduino pin which triggers an piezzo beeper
627
         //arduino pin which triggers an piezzo beeper
1123
      #ifdef LCD_I2C_PANELOLU2
1123
      #ifdef LCD_I2C_PANELOLU2
1124
        #ifdef MELZI
1124
        #ifdef MELZI
1125
          #define BTN_ENC 29 //the click switch
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
        #else
1127
        #else
1128
          #define BTN_ENC 30 //the click switch
1128
          #define BTN_ENC 30 //the click switch
1129
        #endif
1129
        #endif

Laden…
Abbrechen
Speichern