aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/serial_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-25 13:10:39 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-25 13:10:39 +0000
commitac598a7b1c4227cbffbbb1af449f2be21e6976a5 (patch)
tree95de89f1c5c7a443fb962102a4843ab9389b0357 /os/hal/templates/serial_lld.c
parentcced334724aec1f39d683adcda6984543095ba8c (diff)
downloadChibiOS-ac598a7b1c4227cbffbbb1af449f2be21e6976a5.tar.gz
ChibiOS-ac598a7b1c4227cbffbbb1af449f2be21e6976a5.tar.bz2
ChibiOS-ac598a7b1c4227cbffbbb1af449f2be21e6976a5.zip
LLD templates fixed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5319 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/templates/serial_lld.c')
-rw-r--r--os/hal/templates/serial_lld.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/os/hal/templates/serial_lld.c b/os/hal/templates/serial_lld.c
index c48a89e46..79cf9229e 100644
--- a/os/hal/templates/serial_lld.c
+++ b/os/hal/templates/serial_lld.c
@@ -39,6 +39,13 @@
/* Driver exported variables. */
/*===========================================================================*/
+/**
+ * @brief SD1 driver identifier.
+ */
+#if PLATFORM_SERIAL_USE_SD1 || defined(__DOXYGEN__)
+SerialDriver SD1;
+#endif
+
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
@@ -47,6 +54,7 @@
* @brief Driver default configuration.
*/
static const SerialConfig default_config = {
+ 38400
};
/*===========================================================================*/
@@ -68,6 +76,10 @@ static const SerialConfig default_config = {
*/
void sd_lld_init(void) {
+#if PLATFORM_SERIAL_USE_SD1
+ /* Driver initialization.*/
+ sdObjectInit(&SD1);
+#endif /* PLATFORM_SERIAL_USE_SD1 */
}
/**
@@ -85,6 +97,16 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
if (config == NULL)
config = &default_config;
+ if (sdp->state == SD_STOP) {
+ /* Enables the pehipheral.*/
+#if PLATFORM_SERIAL_USE_SD1
+ if (&SD1 == sdp) {
+
+ }
+#endif /* PLATFORM_SD_USE_SD1 */
+ }
+ /* Configures the peripheral.*/
+
}
/**
@@ -98,6 +120,16 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
*/
void sd_lld_stop(SerialDriver *sdp) {
+ if (sdp->state == SD_READY) {
+ /* Resets the peripheral.*/
+
+ /* Disables the peripheral.*/
+#if PLATFORM_SERIAL_USE_SD1
+ if (&SD1 == sdp) {
+
+ }
+#endif /* PLATFORM_SERIAL_USE_SD1 */
+ }
}
#endif /* HAL_USE_SERIAL */