aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARMCM4-STM32F303-DISCOVERY/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-12-04 15:02:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-12-04 15:02:49 +0000
commitd65e5e6b0d687a87abfad5f92a27e5920314f0fa (patch)
tree34546c2c049abf7609b4d94ff0396cb2bc188a98 /demos/ARMCM4-STM32F303-DISCOVERY/main.c
parent1374037cdcc0ec26be0507aa0886624746ed52ae (diff)
downloadChibiOS-d65e5e6b0d687a87abfad5f92a27e5920314f0fa.tar.gz
ChibiOS-d65e5e6b0d687a87abfad5f92a27e5920314f0fa.tar.bz2
ChibiOS-d65e5e6b0d687a87abfad5f92a27e5920314f0fa.zip
Serial support for STM32F3xx.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4871 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARMCM4-STM32F303-DISCOVERY/main.c')
-rw-r--r--demos/ARMCM4-STM32F303-DISCOVERY/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/demos/ARMCM4-STM32F303-DISCOVERY/main.c b/demos/ARMCM4-STM32F303-DISCOVERY/main.c
index 3ff8b8820..587d1f694 100644
--- a/demos/ARMCM4-STM32F303-DISCOVERY/main.c
+++ b/demos/ARMCM4-STM32F303-DISCOVERY/main.c
@@ -20,7 +20,7 @@
#include "ch.h"
#include "hal.h"
-//#include "test.h"
+#include "test.h"
/*
* This is a periodic thread that does absolutely nothing except flashing
@@ -74,7 +74,13 @@ int main(void) {
halInit();
chSysInit();
- /* TODO: inialize serial driver 1 or 2 */
+ /*
+ * Activates the serial driver 1 using the driver default configuration.
+ * PA9(TX) and PA10(RX) are routed to USART1.
+ */
+ sdStart(&SD1, NULL);
+ palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7));
+ palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7));
/*
* Creates the example thread.
@@ -87,9 +93,8 @@ int main(void) {
* pressed the test procedure is launched.
*/
while (TRUE) {
- /* TODO */
-// if (palReadPad(GPIOA, GPIOA_BUTTON))
-// TestThread(&SD2);
+ if (palReadPad(GPIOA, GPIOA_BUTTON))
+ TestThread(&SD1);
chThdSleepMilliseconds(500);
}
}