Compare commits

...

4 Commits

Author SHA1 Message Date
Scott Lahteine e9dda85ddd focus on affective changes 2024-10-19 14:30:44 -05:00
Scott Lahteine beea1f1d14 test this change to see if it breaks anything 2024-10-19 14:13:53 -05:00
Scott Lahteine a9072b00e8 Merge 'bugfix-2.1.x' into pr/27480 2024-10-19 06:01:58 -05:00
InsanityAutomation a530446b62 Partially revert changes from #27392
Changes to SPI in #27392 break Lulzbot TFT SPI communication. Reverting the changes to this file restore operation.

Cardreader changes need investigation, as with these changes machine will boot loop with USB inserted.  Removing the usb at boot, then inserting after init allows it to complete. Does not occur with all changes from this the origin PR reverted.
2024-10-15 18:04:28 -04:00
2 changed files with 11 additions and 4 deletions
+10 -3
View File
@@ -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
+1 -1
View File
@@ -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