From f31cc84c2b29d0b4fe22bb93290471bc15120b85 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 19 Oct 2024 16:12:28 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20LCD=20SPI=20on=20DUE=20(#2?= =?UTF-8?q?7480)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp | 13 ++++++++++--- Marlin/src/feature/easythreed_ui.cpp | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp index a7789c5a64..cf6739c5bd 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -19,9 +19,7 @@ void sd_mmc_spi_mem_init() { } inline bool media_ready() { - return DISABLED(DISABLE_DUE_SD_MMC) - && IS_SD_MOUNTED() && IS_SD_INSERTED() - && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING(); + return IS_SD_MOUNTED() && IS_SD_INSERTED() && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING(); } bool sd_mmc_spi_unload(bool) { return true; } @@ -31,6 +29,9 @@ bool sd_mmc_spi_wr_protect() { return false; } bool sd_mmc_spi_removal() { return !media_ready(); } Ctrl_status sd_mmc_spi_test_unit_ready() { + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; return CTRL_GOOD; } @@ -57,6 +58,9 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE]; // #define DEBUG_MMC Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC @@ -93,6 +97,9 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { } Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC diff --git a/Marlin/src/feature/easythreed_ui.cpp b/Marlin/src/feature/easythreed_ui.cpp index 39248bfc7d..9617c62eb9 100644 --- a/Marlin/src/feature/easythreed_ui.cpp +++ b/Marlin/src/feature/easythreed_ui.cpp @@ -189,7 +189,7 @@ void EasythreedUI::printButton() { blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals print_key_flag = PF_PAUSE; // The "Print" button now pauses the print card.mount(); // Force SD card to mount - now! - if (!card.isMounted) { // Failed to mount? + if (!card.isMounted()) { // Failed to mount? blink_interval_ms = LED_OFF; // Turn off LED print_key_flag = PF_START; return; // Bail out