aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/AVR
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-29 12:29:57 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-29 12:29:57 +0000
commit58d50c17cd4d54b8323e80f2ee188963aa16010b (patch)
tree131e207a767f95da2fd38e333461a9dcaf99a2ea /os/hal/platforms/AVR
parent86e45e167e4db866268e968b174b1cbb88420338 (diff)
downloadChibiOS-58d50c17cd4d54b8323e80f2ee188963aa16010b.tar.gz
ChibiOS-58d50c17cd4d54b8323e80f2ee188963aa16010b.tar.bz2
ChibiOS-58d50c17cd4d54b8323e80f2ee188963aa16010b.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1476 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/AVR')
-rw-r--r--os/hal/platforms/AVR/hal_lld.c10
-rw-r--r--os/hal/platforms/AVR/hal_lld.h4
-rw-r--r--os/hal/platforms/AVR/serial_lld.c23
-rw-r--r--os/hal/platforms/AVR/serial_lld.h22
4 files changed, 41 insertions, 18 deletions
diff --git a/os/hal/platforms/AVR/hal_lld.c b/os/hal/platforms/AVR/hal_lld.c
index 954b6f48a..adf8db71f 100644
--- a/os/hal/platforms/AVR/hal_lld.c
+++ b/os/hal/platforms/AVR/hal_lld.c
@@ -28,23 +28,23 @@
#include "hal.h"
/*===========================================================================*/
-/* Low Level Driver exported variables. */
+/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local variables. */
+/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/platforms/AVR/hal_lld.h b/os/hal/platforms/AVR/hal_lld.h
index b0698e993..65b5da55f 100644
--- a/os/hal/platforms/AVR/hal_lld.h
+++ b/os/hal/platforms/AVR/hal_lld.h
@@ -44,6 +44,10 @@
/*===========================================================================*/
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
diff --git a/os/hal/platforms/AVR/serial_lld.c b/os/hal/platforms/AVR/serial_lld.c
index 1f1bef013..166663c44 100644
--- a/os/hal/platforms/AVR/serial_lld.c
+++ b/os/hal/platforms/AVR/serial_lld.c
@@ -29,31 +29,42 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
-#if USE_AVR_USART0 || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver exported variables. */
+/*===========================================================================*/
+
/**
* @brief USART0 serial driver identifier.
* @note The name does not follow the convention used in the other ports
* (COMn) because a name conflict with the AVR headers.
*/
+#if USE_AVR_USART0 || defined(__DOXYGEN__)
SerialDriver SD1;
#endif
-#if USE_AVR_USART1 || defined(__DOXYGEN__)
+
/**
* @brief USART1 serial driver identifier.
* @note The name does not follow the convention used in the other ports
* (COMn) because a name conflict with the AVR headers.
*/
+#if USE_AVR_USART1 || defined(__DOXYGEN__)
SerialDriver SD2;
#endif
-/** @brief Driver default configuration.*/
+/*===========================================================================*/
+/* Driver local variables. */
+/*===========================================================================*/
+
+/**
+ * @brief Driver default configuration.
+ */
static const SerialDriverConfig default_config = {
UBRR(DEFAULT_USART_BITRATE),
(1 << UCSZ1) | (1 << UCSZ0)
};
/*===========================================================================*/
-/* Low Level Driver local functions. */
+/* Driver local functions. */
/*===========================================================================*/
static void set_error(uint8_t sra, SerialDriver *sdp) {
@@ -131,7 +142,7 @@ static void usart1_deinit(void) {
#endif
/*===========================================================================*/
-/* Low Level Driver interrupt handlers. */
+/* Driver interrupt handlers. */
/*===========================================================================*/
#if USE_AVR_USART0 || defined(__DOXYGEN__)
@@ -201,7 +212,7 @@ CH_IRQ_HANDLER(USART1_UDRE_vect) {
#endif /* USE_AVR_USART1 */
/*===========================================================================*/
-/* Low Level Driver exported functions. */
+/* Driver exported functions. */
/*===========================================================================*/
/**
diff --git a/os/hal/platforms/AVR/serial_lld.h b/os/hal/platforms/AVR/serial_lld.h
index 266bf2a32..ad0ffdd3a 100644
--- a/os/hal/platforms/AVR/serial_lld.h
+++ b/os/hal/platforms/AVR/serial_lld.h
@@ -30,6 +30,10 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@@ -74,7 +78,7 @@
#endif
/*===========================================================================*/
-/* Unsupported event flags and custom events. */
+/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
@@ -120,12 +124,6 @@ struct _serial_driver_data {
};
/**
- * @brief Macro for baud rate computation.
- * @note Make sure the final baud rate is within tolerance.
- */
-#define UBRR(b) ((F_CPU / (b << 4)) - 1)
-
-/**
* @brief AVR Serial Driver configuration structure.
* @details An instance of this structure must be passed to @p sdStart()
* in order to configure and start a serial driver operations.
@@ -136,6 +134,16 @@ typedef struct {
} SerialDriverConfig;
/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/**
+ * @brief Macro for baud rate computation.
+ * @note Make sure the final baud rate is within tolerance.
+ */
+#define UBRR(b) ((F_CPU / (b << 4)) - 1)
+
+/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/