vr1.1

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of CDMS_RTOS_v1_1 by Team Fox

Revision:
8:607ae92fa6af
Parent:
7:c270a9e37290
Child:
11:d6dc9074075b
--- a/SDCard.cpp	Fri Jul 03 08:38:12 2015 +0000
+++ b/SDCard.cpp	Sat Jul 04 08:56:34 2015 +0000
@@ -1,5 +1,7 @@
+#include "mbed.h"
+#include "mbed_debug.h"
 #include "SDCard.h"
-#include "func_head.h"
+#include "all_funcs.h"
 
 SPI spi_SD(PTD6, PTD7, PTD5); // mosi, miso, sclk
 DigitalOut cs_SD(D2);
@@ -31,15 +33,14 @@
  
  // send CMD8 to determine whther it is ver 2.x
     int r = cmd8();
-    if (r == R1_IDLE_STATE) {
+    if (r == R1_IDLE_STATE) 
+    {
         printf("Entering v2 bro\r\n");
         return initialise_card_v2();
         
-    } else if (r == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) {
-        printf("Entering v1 bro\r\n");
-        return initialise_card_v1();
-        
-    } else {
+    }   
+    else 
+    {
         debug("Not in idle state after sending CMD8 (not an SD card?)\r\n");
         return SDCARD_FAIL;
     }