Skip to content

Commit

Permalink
update refs to card.getSd2Card()
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv committed Mar 13, 2021
1 parent 5f21424 commit 1c22473
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready() {
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
*nb_sector = card.getSd2Card().cardSize() - 1;
*nb_sector = card.getSd2Card()->cardSize() - 1;
return CTRL_GOOD;
}

Expand Down Expand Up @@ -74,24 +74,24 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#endif

// Start reading
if (!card.getSd2Card().readStart(addr))
if (!card.getSd2Card()->readStart(addr))
return CTRL_FAIL;

// For each specified sector
while (nb_sector--) {

// Read a sector
card.getSd2Card().readData(sector_buf);
card.getSd2Card()->readData(sector_buf);

// RAM -> USB
if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) {
card.getSd2Card().readStop();
card.getSd2Card()->readStop();
return CTRL_FAIL;
}
}

// Stop reading
card.getSd2Card().readStop();
card.getSd2Card()->readStop();

// Done
return CTRL_GOOD;
Expand All @@ -113,24 +113,24 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
}
#endif

if (!card.getSd2Card().writeStart(addr, nb_sector))
if (!card.getSd2Card()->writeStart(addr, nb_sector))
return CTRL_FAIL;

// For each specified sector
while (nb_sector--) {

// USB -> RAM
if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) {
card.getSd2Card().writeStop();
card.getSd2Card()->writeStop();
return CTRL_FAIL;
}

// Write a sector
card.getSd2Card().writeData(sector_buf);
card.getSd2Card()->writeData(sector_buf);
}

// Stop writing
card.getSd2Card().writeStop();
card.getSd2Card()->writeStop();

// Done
return CTRL_GOOD;
Expand Down

0 comments on commit 1c22473

Please sign in to comment.