flip tile

Dependencies:   FATFileSystem

Fork of SDFileSystem by mbed official

Revision:
4:331210e075be
Parent:
2:c8f66dc765d4
--- a/SDFileSystem.cpp	Thu Nov 29 10:56:21 2012 +0000
+++ b/SDFileSystem.cpp	Thu Oct 22 15:25:57 2015 +0000
@@ -240,6 +240,20 @@
 int SDFileSystem::disk_sync() { return 0; }
 uint64_t SDFileSystem::disk_sectors() { return _sectors; }
 
+//function to check if there is an SD card inserted
+bool SDFileSystem::SD_inserted()
+{
+    DigitalIn enable(p20);
+    enable.mode(PullUp);
+    
+    if(enable)
+        inserted = true; //returns true if inserted
+    else
+        inserted = false; //returns false otherwise
+        
+    return(inserted);
+}
+
 
 // PRIVATE FUNCTIONS
 int SDFileSystem::_cmd(int cmd, int arg) {