Use "mount" as card verb
This commit is contained in:
@ -19,7 +19,7 @@ void sd_mmc_spi_mem_init(void) {
|
||||
}
|
||||
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready(void) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
@ -27,7 +27,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) {
|
||||
// NOTE: This function is defined as returning the address of the last block
|
||||
// in the card, which is cardSize() - 1
|
||||
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
*nb_sector = card.getSd2Card().cardSize() - 1;
|
||||
return CTRL_GOOD;
|
||||
@ -43,7 +43,7 @@ bool sd_mmc_spi_wr_protect(void) {
|
||||
}
|
||||
|
||||
bool sd_mmc_spi_removal(void) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -62,7 +62,7 @@ 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) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
@ -99,7 +99,7 @@ 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) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
|
@ -158,7 +158,7 @@ void HAL_idletask(void) {
|
||||
// the disk if Marlin has it mounted. Unfortuately there is currently no way
|
||||
// to unmount the disk from the LCD menu.
|
||||
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
|
||||
if (card.isDetected())
|
||||
if (card.isMounted())
|
||||
MSC_Aquire_Lock();
|
||||
else
|
||||
MSC_Release_Lock();
|
||||
|
@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
#define EEPROM_FILENAME "eeprom.dat"
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
|
||||
@ -62,7 +62,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
int bytes_written = 0;
|
||||
|
@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
#define EEPROM_FILENAME "eeprom.dat"
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
|
||||
@ -63,7 +63,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE];
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
if (!card.isDetected()) return false;
|
||||
if (!card.isMounted()) return false;
|
||||
|
||||
SdFile file, root = card.getroot();
|
||||
int bytes_written = 0;
|
||||
|
Reference in New Issue
Block a user