efe

Dependencies:   mbed

Fork of raw_sd_card_disc_init by Pradeep Kotipalli

Revision:
1:1843a53b51a8
Parent:
0:d4197e4552ea
Child:
2:aea18e9b89d8
diff -r d4197e4552ea -r 1843a53b51a8 main.cpp
--- 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;
         }
     }