From adcc2971fb9ff9022e61e0871e78f2393a1d4caf Mon Sep 17 00:00:00 2001 From: LawnMo <81721212+LawnMo@users.noreply.github.com> Date: Mon, 24 May 2021 10:22:48 +0200 Subject: [PATCH 1/3] Fix compilation error with multi_volume and SDIO onboard Marlin\src\sd\cardreader.cpp: In constructor 'CardReader::CardReader()': Marlin\src\sd\cardreader.cpp:147:7: error: 'media_sd_spi' was not declared in this scope; did you mean 'media_sdio'? --- Marlin/src/sd/cardreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 405da103de73..3890b08147de 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -144,7 +144,7 @@ uint32_t CardReader::filesize, CardReader::sdpos; CardReader::CardReader() { changeMedia(& #if SHARED_VOLUME_IS(SD_ONBOARD) - media_sd_spi + TERN(SDIO_SUPPORT, media_sdio, media_sd_spi) #elif SHARED_VOLUME_IS(USB_FLASH_DRIVE) || ENABLED(USB_FLASH_DRIVE_SUPPORT) media_usbFlashDrive #else From 222195689203ee15c830cdfc87098782ccbdf26a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 24 May 2021 17:26:41 -0500 Subject: [PATCH 2/3] tweak conditions --- Marlin/src/sd/cardreader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 3890b08147de..5d314ed1aede 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -143,9 +143,7 @@ uint32_t CardReader::filesize, CardReader::sdpos; CardReader::CardReader() { changeMedia(& - #if SHARED_VOLUME_IS(SD_ONBOARD) - TERN(SDIO_SUPPORT, media_sdio, media_sd_spi) - #elif SHARED_VOLUME_IS(USB_FLASH_DRIVE) || ENABLED(USB_FLASH_DRIVE_SUPPORT) + #if SHARED_VOLUME_IS(USB_FLASH_DRIVE) || (ENABLED(USB_FLASH_DRIVE_SUPPORT) && !SHARED_VOLUME_IS(SD_ONBOARD)) media_usbFlashDrive #else TERN(SDIO_SUPPORT, media_sdio, media_sd_spi) From ddc7da7b0a590703e4aabdafb8ca239c59001663 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 24 May 2021 17:51:08 -0500 Subject: [PATCH 3/3] retweak --- Marlin/src/sd/cardreader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 5d314ed1aede..3890b08147de 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -143,7 +143,9 @@ uint32_t CardReader::filesize, CardReader::sdpos; CardReader::CardReader() { changeMedia(& - #if SHARED_VOLUME_IS(USB_FLASH_DRIVE) || (ENABLED(USB_FLASH_DRIVE_SUPPORT) && !SHARED_VOLUME_IS(SD_ONBOARD)) + #if SHARED_VOLUME_IS(SD_ONBOARD) + TERN(SDIO_SUPPORT, media_sdio, media_sd_spi) + #elif SHARED_VOLUME_IS(USB_FLASH_DRIVE) || ENABLED(USB_FLASH_DRIVE_SUPPORT) media_usbFlashDrive #else TERN(SDIO_SUPPORT, media_sdio, media_sd_spi)