A re-written SDFileSystem library with improved compatibility, CRC support, and card removal/replacement support.

Dependencies:   FATFileSystem

Dependents:   xadow_m0_SD_Hello roam_v1 roam_v2 Polytech_tours ... more

Files at this revision

API Documentation at this revision

Comitter:
neilt6
Date:
Wed Jul 30 17:51:33 2014 +0000
Parent:
3:7cf3d1835ef5
Child:
5:6befff2300d0
Commit message:
Added 0x40 to command definitions for (slightly) improved performance

Changed in this revision

SDFileSystem.cpp Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.h Show annotated file Show diff for this revision Revisions of this file
--- a/SDFileSystem.cpp	Wed Jul 30 17:45:02 2014 +0000
+++ b/SDFileSystem.cpp	Wed Jul 30 17:51:33 2014 +0000
@@ -411,7 +411,7 @@
 
         //Prepare the command packet
         char cmdPacket[6];
-        cmdPacket[0] = 0x40 | cmd;
+        cmdPacket[0] = cmd;
         cmdPacket[1] = arg >> 24;
         cmdPacket[2] = arg >> 16;
         cmdPacket[3] = arg >> 8;
--- a/SDFileSystem.h	Wed Jul 30 17:45:02 2014 +0000
+++ b/SDFileSystem.h	Wed Jul 30 17:51:33 2014 +0000
@@ -110,17 +110,17 @@
 private:
     //Commands
     enum Command {
-        CMD0 = 0,       /**< GO_IDLE_STATE */
-        CMD1 = 1,       /**< SEND_OP_COND */
-        ACMD41 = 41,    /**< APP_SEND_OP_COND */
-        CMD8 = 8,       /**< SEND_IF_COND */
-        CMD9 = 9,       /**< SEND_CSD */
-        CMD16 = 16,     /**< SET_BLOCKLEN */
-        CMD17 = 17,     /**< READ_SINGLE_BLOCK */
-        CMD24 = 24,     /**< WRITE_BLOCK */
-        CMD55 = 55,     /**< APP_CMD */
-        CMD58 = 58,     /**< READ_OCR */
-        CMD59 = 59      /**< CRC_ON_OFF */
+        CMD0 = (0x40 | 0),      /**< GO_IDLE_STATE */
+        CMD1 = (0x40 | 1),      /**< SEND_OP_COND */
+        ACMD41 = (0x40 | 41),   /**< APP_SEND_OP_COND */
+        CMD8 = (0x40 | 8),      /**< SEND_IF_COND */
+        CMD9 = (0x40 | 9),      /**< SEND_CSD */
+        CMD16 = (0x40 | 16),    /**< SET_BLOCKLEN */
+        CMD17 = (0x40 | 17),    /**< READ_SINGLE_BLOCK */
+        CMD24 = (0x40 | 24),    /**< WRITE_BLOCK */
+        CMD55 = (0x40 | 55),    /**< APP_CMD */
+        CMD58 = (0x40 | 58),    /**< READ_OCR */
+        CMD59 = (0x40 | 59)     /**< CRC_ON_OFF */
     };
 
     //Member variables