Prefix SD SPI pins (SCK, MISO, MOSI, SS) (#20606)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Victor Oliveira
2021-01-01 17:31:15 -03:00
committed by GitHub
parent b530db948e
commit c840bbc970
109 changed files with 612 additions and 613 deletions

View File

@ -379,9 +379,9 @@ void CardReader::mount() {
flag.mounted = false;
if (root.isOpen()) root.close();
if (!sd2card.init(SPI_SPEED, SDSS)
if (!sd2card.init(SD_SPI_SPEED, SDSS)
#if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
&& !sd2card.init(SPI_SPEED, LCD_SDSS)
&& !sd2card.init(SD_SPI_SPEED, LCD_SDSS)
#endif
) SERIAL_ECHO_MSG(STR_SD_INIT_FAIL);
else if (!volume.init(&sd2card))

View File

@ -50,7 +50,7 @@
#if ENABLED(USE_UHS3_USB)
#define NO_AUTO_SPEED
#define UHS_MAX3421E_SPD 8000000 >> SPI_SPEED
#define UHS_MAX3421E_SPD 8000000 >> SD_SPI_SPEED
#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 1
#define UHS_HOST_MAX_INTERFACE_DRIVERS 2
#define MASS_MAX_SUPPORTED_LUN 1

View File

@ -42,7 +42,7 @@
#define SD_CHIP_SELECT_PIN 10 // Software SPI chip select pin for the SD
#else
// hardware pin defs
#define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS.
#define SD_CHIP_SELECT_PIN SD_SS_PIN // The default chip select pin for the SD card is SS.
#endif
#endif

View File

@ -114,13 +114,7 @@ bool MAX3421e::start() {
ncs();
spiBegin();
spiInit(
#ifdef SPI_SPEED
SPI_SPEED
#else
SPI_FULL_SPEED
#endif
);
spiInit(SD_SPI_SPEED);
// MAX3421e - full-duplex, level interrupt, vbus off.
regWr(rPINCTL, (bmFDUPSPI | bmINTLEVEL | GPX_VBDET));