Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-09-16 17:24:58 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-09-16 17:24:58 +0300
commitb732e293856240d575e58052160c180cd605d23c (patch)
tree0bc21a168d2a0dc1378093c2a8e51f52d644db89
parentc73ba74cc8310ffe70f918e3be2b540c1beb78be (diff)
Set up correct external SD card pins on Duet 3 MB6HC 1.02
-rw-r--r--src/Config/Pins_Duet3_MB6HC.h8
-rw-r--r--src/Storage/MassStorage.cpp4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/Config/Pins_Duet3_MB6HC.h b/src/Config/Pins_Duet3_MB6HC.h
index c773d284..2dab95d8 100644
--- a/src/Config/Pins_Duet3_MB6HC.h
+++ b/src/Config/Pins_Duet3_MB6HC.h
@@ -168,10 +168,12 @@ constexpr Pin UsbModePin = PortCPin(20);
constexpr Pin UsbDetectPin = PortCPin(19);
// SD cards
-constexpr size_t NumSdCards = 2; // we now allow one SPI-connected SD card to be configured at boot time
-constexpr Pin SdCardDetectPins[NumSdCards] = { PortAPin(29), NoPin }; // the CD pin for the second SD card is allocated using M950
+// PD24 is SWD_EXT_RESET on pre-1.02 boards, PanelDue Card Detect on 1.20 and later
+// PD24 is not connected on pre-1.02 boards, SPI_CS4 on 1.02 and later
+constexpr size_t NumSdCards = 2; // we now allow one SPI-connected SD card to be configured at boot time
+constexpr Pin SdCardDetectPins[NumSdCards] = { PortAPin(29), PortDPin(24) }; // the CD pin for the second SD card is allocated using M950 on MB6HC boards before version 1.02
constexpr Pin SdWriteProtectPins[NumSdCards] = { NoPin, NoPin };
-constexpr Pin SdSpiCSPins[1] = { NoPin }; // this one is allocated using M950
+constexpr Pin SdSpiCSPins[1] = { PortDPin(22) }; // this one is allocated using M950 on MB6HC boards before version 1.02
constexpr uint32_t ExpectedSdCardSpeed = 25000000;
constexpr IRQn SdhcIRQn = HSMCI_IRQn;
diff --git a/src/Storage/MassStorage.cpp b/src/Storage/MassStorage.cpp
index d67ac669..d1ac291d 100644
--- a/src/Storage/MassStorage.cpp
+++ b/src/Storage/MassStorage.cpp
@@ -211,6 +211,10 @@ GCodeResult MassStorage::ConfigureSdCard(GCodeBuffer& gb, const StringRef& reply
}
sd_mmc_change_cs_pin(1, sd1Ports[0].GetPin());
info[1].cdPin = sd1Ports[1].GetPin();
+ if (info[1].cdPin == NoPin)
+ {
+ info[1].cardState = CardDetectState::present;
+ }
reprap.VolumesUpdated();
}
else