fat32

Dependencies:   FATFileSystem

Dependents:   MW771LP-2seam

Fork of SDFileSystem by Neil Thiessen

Files at this revision

API Documentation at this revision

Comitter:
vnemera
Date:
Fri Feb 17 16:43:38 2017 +0000
Parent:
21:d10a519c0910
Child:
23:2d0b915b7439
Commit message:
1.4.4

Changed in this revision

FATFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
SDCRC.h Show annotated file Show diff for this revision Revisions of this file
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/FATFileSystem.lib	Fri Dec 11 16:30:36 2015 +0000
+++ b/FATFileSystem.lib	Fri Feb 17 16:43:38 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/mbed-official/code/FATFileSystem/#094f84646b9f
+http://mbed.org/teams/mbed-official/code/FATFileSystem/#0345cdc7efa5
--- a/SDCRC.h	Fri Dec 11 16:30:36 2015 +0000
+++ b/SDCRC.h	Fri Feb 17 16:43:38 2017 +0000
@@ -17,8 +17,6 @@
 #ifndef SD_CRC_H
 #define SD_CRC_H
 
-#include "mbed.h"
-
 namespace SDCRC
 {
 
--- a/SDFileSystem.cpp	Fri Dec 11 16:30:36 2015 +0000
+++ b/SDFileSystem.cpp	Fri Feb 17 16:43:38 2017 +0000
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #include "SDFileSystem.h"
 #include "diskio.h"
 #include "pinmap.h"
@@ -24,10 +23,10 @@
     //Initialize the member variables
     m_CardType = CARD_NONE;
     m_Crc = true;
-    m_LargeFrames = false;
+    m_LargeFrames = true;
     m_WriteValidation = true;
-    m_Status = STA_NOINIT;
-
+    //m_Status = STA_NOINIT;
+    m_Status = (STA_NODISK | STA_NOINIT);
     //Enable the internal pull-up resistor on MISO
     pin_mode(miso, PullUp);
 
@@ -410,22 +409,27 @@
 inline void SDFileSystem::checkSocket()
 {
     //Use the card detect switch (if available) to determine if the socket is occupied
-    if (m_CdAssert != -1) {
+    if (m_CdAssert != 1) {
         if (m_Status & STA_NODISK) {
+            //printf("-%u ", m_Status);
             if (m_Cd == m_CdAssert) {
                 //The socket is now occupied
                 m_Status &= ~STA_NODISK;
                 m_CardType = CARD_UNKNOWN;
+                //printf("chS1");
             }
-        } else {
+        }
+        else {
+            //printf(">%u ", m_Status);
             if (m_Cd != m_CdAssert) {
                 //The socket is now empty
                 m_Status |= (STA_NODISK | STA_NOINIT);
                 m_CardType = CARD_NONE;
+                //printf("chS3");
             }
         }
     }
-}
+ }
 
 inline bool SDFileSystem::waitReady(int timeout)
 {
--- a/SDFileSystem.h	Fri Dec 11 16:30:36 2015 +0000
+++ b/SDFileSystem.h	Fri Feb 17 16:43:38 2017 +0000
@@ -100,6 +100,7 @@
      * @param cdtype The type of card detect switch.
      * @param hz The SPI bus frequency (defaults to 1MHz).
      */
+    //SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name, PinName cd = NC, SwitchType cdtype = SWITCH_NONE, int hz = 1000000);
     SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name, PinName cd = NC, SwitchType cdtype = SWITCH_NONE, int hz = 1000000);
 
     /** Determine whether or not a card is present