From ba01b11a39f178169fe1517458cbfc9c3f5f9a0f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 19 May 2012 12:28:14 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4214 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM0-STM32F051-DISCOVERY/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'demos/ARMCM0-STM32F051-DISCOVERY/main.c') 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 @@ -69,6 +69,14 @@ int main(void) { halInit(); 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. */ @@ -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); } } -- cgit v1.2.3