Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SDFileSystem by
Diff: SDFileSystem.cpp
- Revision:
- 4:f95eac15eaba
- Parent:
- 3:7b35d1709458
diff -r 7b35d1709458 -r f95eac15eaba SDFileSystem.cpp
--- a/SDFileSystem.cpp Mon Mar 17 14:34:01 2014 +0000
+++ b/SDFileSystem.cpp Tue Sep 29 21:29:51 2015 +0000
@@ -149,7 +149,7 @@
// send CMD0, should return with all zeros except IDLE STATE set (bit 0)
if (_cmd(0, 0) != R1_IDLE_STATE) {
- debug("No disk, or could not put SD card in to SPI idle state\n");
+ //debug("N\n");
return SDCARD_FAIL;
}
@@ -160,7 +160,7 @@
} else if (r == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) {
return initialise_card_v1();
} else {
- debug("Not in idle state after sending CMD8 (not an SD card?)\n");
+ //debug("\n");
return SDCARD_FAIL;
}
}
@@ -170,7 +170,7 @@
_cmd(55, 0);
if (_cmd(41, 0) == 0) {
cdv = 512;
- debug_if(SD_DBG, "\n\rInit: SEDCARD_V1\n\r");
+ //debug_if(SD_DBG, "\n\rInit: SEDCARD_V1\n\r");
return SDCARD_V1;
}
}
@@ -186,7 +186,7 @@
_cmd(55, 0);
if (_cmd(41, 0x40000000) == 0) {
_cmd58();
- debug_if(SD_DBG, "\n\rInit: SDCARD_V2\n\r");
+ //debug_if(SD_DBG, "\n\rInit: SDCARD_V2\n\r");
cdv = 1;
return SDCARD_V2;
}
@@ -198,7 +198,7 @@
int SDFileSystem::disk_initialize() {
int i = initialise_card();
- debug_if(SD_DBG, "init card = %d\n", i);
+ //debug_if(SD_DBG, "init card = %d\n", i);
_sectors = _sd_sectors();
// Set block length to 512 (CMD16)
@@ -415,13 +415,13 @@
// CMD9, Response R2 (R1 byte + 16-byte block read)
if (_cmdx(9, 0) != 0) {
- debug("Didn't get a response from the disk\n");
+ debug("\n");
return 0;
}
uint8_t csd[16];
if (_read(csd, 16) != 0) {
- debug("Couldn't read csd response from disk\n");
+ debug("\n");
return 0;
}
@@ -444,18 +444,18 @@
blocknr = (c_size + 1) * mult;
capacity = blocknr * block_len;
blocks = capacity / 512;
- debug_if(SD_DBG, "\n\rSDCard\n\rc_size: %d \n\rcapacity: %ld \n\rsectors: %lld\n\r", c_size, capacity, blocks);
+ //debug_if(SD_DBG, "\n\r\n\rc_size: %d %ld \%lld\n\r", c_size, capacity, blocks);
break;
case 1:
cdv = 1;
hc_c_size = ext_bits(csd, 63, 48);
blocks = (hc_c_size+1)*1024;
- debug_if(SD_DBG, "\n\rSDHC Card \n\rhc_c_size: %d\n\rcapacity: %lld \n\rsectors: %lld\n\r", hc_c_size, blocks*512, blocks);
+ //debug_if(SD_DBG, "\n\rS \n\rhc_c_size: %d\n\rcapacity: %lld \n\rsectors: %lld\n\r", hc_c_size, blocks*512, blocks);
break;
default:
- debug("CSD struct unsupported\r\n");
+ debug("\r\n");
return 0;
};
return blocks;
