SD card interface

Revision:
0:22612ae617a0
diff -r 000000000000 -r 22612ae617a0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 08 11:14:07 2012 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "USBMSD_SD.h"
+#include "watchdog.h"
+
+Serial pc(USBTX, USBRX);
+USBMSD_SD sd(p5, p6, p7, p8, p9, LED1, p14);
+DigitalOut myled(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+
+int main() {
+    WDTInit();
+    while (1) {
+        if (!sd.disk_present()) {
+            myled2 = 0;
+            sd.disconnect();
+            NVIC_SystemReset();
+            while (!sd.disk_present()) {};
+            wait(.5);
+        } else {
+            myled2 = 1;
+        }
+        if ((LPC_WWDT->MOD >> 2) & 1) {
+            myled3 = 1;
+        }
+        feed();
+    }
+}
\ No newline at end of file