Skip to content

Commit 88f0998

Browse files
committed
print sd error, fix card capacity print
1 parent 85c98b6 commit 88f0998

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/MassStorage/msc_external_flash_sdcard/msc_external_flash_sdcard.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ bool init_sdcard(void)
138138

139139
if ( !sd.begin(SDCARD_CS, SD_SCK_MHZ(50)) )
140140
{
141-
Serial.print("Failed");
141+
Serial.print("Failed ");
142+
sd.errorPrint();
143+
142144
return false;
143145
}
144146

@@ -149,7 +151,7 @@ bool init_sdcard(void)
149151
sd_changed = true; // to print contents initially
150152

151153
Serial.print("OK, Card size = ");
152-
Serial.print(block_count * 512 / (1024*1024));
154+
Serial.print((block_count / (1024*1024)) * 512);
153155
Serial.println(" MB");
154156

155157
return true;

0 commit comments

Comments
 (0)