aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-19 12:28:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-19 12:28:14 +0000
commitba01b11a39f178169fe1517458cbfc9c3f5f9a0f (patch)
tree93ff1d26d9b9b948131435a1503a73eb9b2a72c3 /demos
parent60ed87c8418ecbab461e98efbfe170185cee2556 (diff)
downloadChibiOS-ba01b11a39f178169fe1517458cbfc9c3f5f9a0f.tar.gz
ChibiOS-ba01b11a39f178169fe1517458cbfc9c3f5f9a0f.tar.bz2
ChibiOS-ba01b11a39f178169fe1517458cbfc9c3f5f9a0f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4214 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM0-STM32F051-DISCOVERY/halconf.h2
-rw-r--r--demos/ARMCM0-STM32F051-DISCOVERY/main.c12
-rw-r--r--demos/ARMCM0-STM32F051-DISCOVERY/mcuconf.h8
3 files changed, 19 insertions, 3 deletions
diff --git a/demos/ARMCM0-STM32F051-DISCOVERY/halconf.h b/demos/ARMCM0-STM32F051-DISCOVERY/halconf.h
index 91d295ccf..c9b3ad25a 100644
--- a/demos/ARMCM0-STM32F051-DISCOVERY/halconf.h
+++ b/demos/ARMCM0-STM32F051-DISCOVERY/halconf.h
@@ -129,7 +129,7 @@
* @brief Enables the SERIAL subsystem.
*/
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL FALSE
+#define HAL_USE_SERIAL TRUE
#endif
/**
diff --git a/demos/ARMCM0-STM32F051-DISCOVERY/main.c b/demos/ARMCM0-STM32F051-DISCOVERY/main.c
index 11b58a39d..5af0813e9 100644
--- a/demos/ARMCM0-STM32F051-DISCOVERY/main.c
+++ b/demos/ARMCM0-STM32F051-DISCOVERY/main.c
@@ -70,6 +70,14 @@ int main(void) {
chSysInit();
/*
+ * Activates the serial driver 1 using the driver default configuration.
+ * PA9 and PA10 are routed to USART1.
+ */
+ sdStart(&SD1, NULL);
+ palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1)); /* USART1 TX. */
+ palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(1)); /* USART1 RX. */
+
+ /*
* Creates the blinker threads.
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
@@ -82,8 +90,8 @@ int main(void) {
* driver 1.
*/
while (TRUE) {
- /*if (palReadPad(GPIOA, GPIOA_BUTTON))
- TestThread(&SD1);*/
+ if (palReadPad(GPIOA, GPIOA_BUTTON))
+ TestThread(&SD1);
chThdSleepMilliseconds(500);
}
}
diff --git a/demos/ARMCM0-STM32F051-DISCOVERY/mcuconf.h b/demos/ARMCM0-STM32F051-DISCOVERY/mcuconf.h
index 4b3fa74fd..3ee724511 100644
--- a/demos/ARMCM0-STM32F051-DISCOVERY/mcuconf.h
+++ b/demos/ARMCM0-STM32F051-DISCOVERY/mcuconf.h
@@ -58,3 +58,11 @@
#define STM32_I2C1SW STM32_I2C1SW_HSI
#define STM32_USART1SW STM32_USART1SW_PCLK
#define STM32_RTCSEL STM32_RTCSEL_LSI
+
+/*
+ * SERIAL driver system settings.
+ */
+#define STM32_SERIAL_USE_USART1 TRUE
+#define STM32_SERIAL_USE_USART2 FALSE
+#define STM32_SERIAL_USART1_PRIORITY 3
+#define STM32_SERIAL_USART2_PRIORITY 3