diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-13 16:59:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-13 16:59:32 +0000 |
commit | bb6d225f57811ded378ffcb2457454decdb98e1c (patch) | |
tree | 1d4e61fd481495424d182664fccadd6b7942fb22 /demos/STM8L-STM8L152-DISCOVERY-STVD/demo | |
parent | 1d6a32367685583864d10cba03102578e15f04c8 (diff) | |
download | ChibiOS-bb6d225f57811ded378ffcb2457454decdb98e1c.tar.gz ChibiOS-bb6d225f57811ded378ffcb2457454decdb98e1c.tar.bz2 ChibiOS-bb6d225f57811ded378ffcb2457454decdb98e1c.zip |
Initial STM8L support.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2359 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/STM8L-STM8L152-DISCOVERY-STVD/demo')
-rw-r--r-- | demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h | 2 | ||||
-rw-r--r-- | demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h index 40bb5dbb1..3186be527 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/halconf.h @@ -90,7 +90,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/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c index 6e61e0521..d1545a84d 100644 --- a/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c +++ b/demos/STM8L-STM8L152-DISCOVERY-STVD/demo/main.c @@ -30,13 +30,13 @@ static msg_t Thread1(void *arg) { (void)arg;
while (TRUE) {
palSetPad(GPIOC, PC_LED4);
- chThdSleepMilliseconds(500);
+ chThdSleepMilliseconds(250);
palClearPad(GPIOC, PC_LED4);
- chThdSleepMilliseconds(500);
+ chThdSleepMilliseconds(250);
palSetPad(GPIOE, PE_LED3);
- chThdSleepMilliseconds(500);
+ chThdSleepMilliseconds(250);
palClearPad(GPIOE, PE_LED3);
- chThdSleepMilliseconds(500);
+ chThdSleepMilliseconds(250);
}
return 0;
}
@@ -58,8 +58,10 @@ void main(void) { /*
* Activates the serial driver 1 using the driver default configuration.
+ * The STM8L-Discovery requires USART1 pins remapping on PA2 and PA3.
*/
-// sdStart(&SD1, NULL);
+ SYSCFG->RMPCR1 = 0x1C;
+ sdStart(&SD1, NULL);
/*
* Creates the blinker thread.
@@ -70,8 +72,8 @@ void main(void) { * Normal main() thread activity.
*/
while (TRUE) {
-// if (palReadPad(GPIOC, PC_BUTTON) == PAL_LOW)
-// TestThread(&SD1);
+ if (palReadPad(GPIOC, PC_BUTTON) == PAL_LOW)
+ TestThread(&SD1);
chThdSleepMilliseconds(1000);
}
}
|