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 raw_sd_card_readsaswell by
Revision 1:1843a53b51a8, committed 2015-06-06
- Comitter:
- pradeepvk2208
- Date:
- Sat Jun 06 09:58:13 2015 +0000
- Parent:
- 0:d4197e4552ea
- Child:
- 2:aea18e9b89d8
- Commit message:
- qbfkjehfiwgh
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jun 06 09:49:36 2015 +0000
+++ b/main.cpp Sat Jun 06 09:58:13 2015 +0000
@@ -40,6 +40,7 @@
{ initialise_card();
int result= initialise_card();
printf("%d\n",result);
+ wait(5);
}
}
@@ -64,8 +65,10 @@
int r = cmd8();
if (r == R1_IDLE_STATE) {
return initialise_card_v2();
+ printf("Entering v2 bro");
} else if (r == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) {
return initialise_card_v1();
+ printf("Entering v1 bro");
} else {
debug("Not in idle state after sending CMD8 (not an SD card?)\n");
return SDCARD_FAIL;
@@ -76,8 +79,10 @@
for (int i = 0; i < SD_COMMAND_TIMEOUT; i++) {
cmd(55, 0);
if (cmd(41, 0) == 0) {
+ printf("Yuppie v1 successful");
cdv = 512;
debug_if(SD_DBG, "\n\rInit: SEDCARD_V1\n\r");
+
return SDCARD_V1;
}
}
@@ -93,9 +98,11 @@
cmd58();
cmd(55, 0);
if (cmd(41, 0x40000000) == 0) {
+ printf("Yuppie,v2 successful");
cmd58();
debug_if(SD_DBG, "\n\rInit: SDCARD_V2\n\r");
cdv = 1;
+
return SDCARD_V2;
}
}
