Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison 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 |
comparison
equal
deleted
inserted
replaced
48:2f336d212c74 | 49:ace431a0d0f5 |
---|---|
17 #include "flash.h" | 17 #include "flash.h" |
18 #include "hw.h" | 18 #include "hw.h" |
19 #include "lcd.h" | 19 #include "lcd.h" |
20 #include "main.h" | 20 #include "main.h" |
21 #include "rtc.h" | 21 #include "rtc.h" |
22 #include "sd.h" | |
22 #include "sprink.h" | 23 #include "sprink.h" |
23 #include "tempctrl.h" | 24 #include "tempctrl.h" |
24 #include "touch.h" | 25 #include "touch.h" |
25 | 26 |
26 #define MAXARGS 10 | 27 #define MAXARGS 10 |
158 /* Setup temperature control stuff */ | 159 /* Setup temperature control stuff */ |
159 tempctrl_init(); | 160 tempctrl_init(); |
160 | 161 |
161 /* Setup sprinkler stuff */ | 162 /* Setup sprinkler stuff */ |
162 sprink_init(); | 163 sprink_init(); |
164 | |
165 /* Setup SD card */ | |
166 sd_init(); | |
163 | 167 |
164 while (1) { | 168 while (1) { |
165 fputs("> ", stdout); | 169 fputs("> ", stdout); |
166 | 170 |
167 while (cmd.state != 255) { | 171 while (cmd.state != 255) { |
352 maxerr = err; | 356 maxerr = err; |
353 } | 357 } |
354 printf("Max err = %.3f\n", maxerr); | 358 printf("Max err = %.3f\n", maxerr); |
355 } else if (!strcmp("assert", argv[0])) { | 359 } else if (!strcmp("assert", argv[0])) { |
356 assert(0 == 1); | 360 assert(0 == 1); |
361 } else if (!strcmp("sd", argv[0])) { | |
362 sd_cmd(argc - 1, argv + 1); | |
357 } else if (!strcmp("zz", argv[0])) { | 363 } else if (!strcmp("zz", argv[0])) { |
358 NVIC_SystemReset(); | 364 NVIC_SystemReset(); |
359 } else { | 365 } else { |
360 printf("Unknown command\n"); | 366 printf("Unknown command\n"); |
361 } | 367 } |