diff main.c @ 49:ace431a0d0f5

Add SDIO code poached from STM. Use FatFS to read from SD card. LFN doesn't work reliably so it's disabled for now.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 03 Apr 2013 23:34:20 +1030
parents 5b7d21698a80
children b21db2b47a27
line wrap: on
line diff
--- a/main.c	Wed Apr 03 23:33:47 2013 +1030
+++ b/main.c	Wed Apr 03 23:34:20 2013 +1030
@@ -19,6 +19,7 @@
 #include "lcd.h"
 #include "main.h"
 #include "rtc.h"
+#include "sd.h"
 #include "sprink.h"
 #include "tempctrl.h"
 #include "touch.h"
@@ -161,6 +162,9 @@
     /* Setup sprinkler stuff */
     sprink_init();
     
+    /* Setup SD card */
+    sd_init();
+    
     while (1) {
 	fputs("> ", stdout);
 	
@@ -354,6 +358,8 @@
 	    printf("Max err = %.3f\n", maxerr);
 	} else if (!strcmp("assert", argv[0])) {
 	    assert(0 == 1);
+	} else if (!strcmp("sd", argv[0])) {
+	    sd_cmd(argc - 1, argv + 1);
 	} else if (!strcmp("zz", argv[0])) {
 	    NVIC_SystemReset();
 	} else {