From 26790f9fb067095c855498241ababa35ce17e555 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Dec 2009 12:49:12 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1479 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/MSP430/hal_lld.c | 10 +++++----- os/hal/platforms/MSP430/hal_lld.h | 4 ++++ os/hal/platforms/MSP430/pal_lld.c | 20 ++++++++++++++++++++ os/hal/platforms/MSP430/serial_lld.c | 14 +++++++++++--- os/hal/platforms/MSP430/serial_lld.h | 30 +++++++++++++++++++----------- 5 files changed, 59 insertions(+), 19 deletions(-) (limited to 'os/hal/platforms/MSP430') diff --git a/os/hal/platforms/MSP430/hal_lld.c b/os/hal/platforms/MSP430/hal_lld.c index 9b878eb36..d511f7f6e 100644 --- a/os/hal/platforms/MSP430/hal_lld.c +++ b/os/hal/platforms/MSP430/hal_lld.c @@ -28,7 +28,7 @@ #include "hal.h" /*===========================================================================*/ -/* Low Level Driver exported variables. */ +/* Driver exported variables. */ /*===========================================================================*/ /** @@ -58,19 +58,19 @@ const MSP430DIOConfig pal_default_config = }; /*===========================================================================*/ -/* 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/MSP430/hal_lld.h b/os/hal/platforms/MSP430/hal_lld.h index 2795a7edc..236ee56c4 100644 --- a/os/hal/platforms/MSP430/hal_lld.h +++ b/os/hal/platforms/MSP430/hal_lld.h @@ -86,6 +86,10 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ diff --git a/os/hal/platforms/MSP430/pal_lld.c b/os/hal/platforms/MSP430/pal_lld.c index fe8acadcd..38806a7f8 100644 --- a/os/hal/platforms/MSP430/pal_lld.c +++ b/os/hal/platforms/MSP430/pal_lld.c @@ -29,6 +29,26 @@ #if CH_HAL_USE_PAL || defined(__DOXYGEN__) +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + /** * @brief MSP430 I/O ports configuration. * diff --git a/os/hal/platforms/MSP430/serial_lld.c b/os/hal/platforms/MSP430/serial_lld.c index a69944bf7..caa0e99d0 100644 --- a/os/hal/platforms/MSP430/serial_lld.c +++ b/os/hal/platforms/MSP430/serial_lld.c @@ -31,6 +31,10 @@ #if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + #if USE_MSP430_USART0 || defined(__DOXYGEN__) /** @brief USART0 serial driver identifier.*/ SerialDriver SD1; @@ -40,6 +44,10 @@ SerialDriver SD1; SerialDriver SD2; #endif +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + /** @brief Driver default configuration.*/ static const SerialDriverConfig default_config = { UBR(DEFAULT_USART_BITRATE), @@ -48,7 +56,7 @@ static const SerialDriverConfig default_config = { }; /*===========================================================================*/ -/* Low Level Driver local functions. */ +/* Driver local functions. */ /*===========================================================================*/ static void set_error(uint8_t urctl, SerialDriver *sdp) { @@ -150,7 +158,7 @@ static void usart1_deinit(void) { #endif /* USE_MSP430_USART1 */ /*===========================================================================*/ -/* Low Level Driver interrupt handlers. */ +/* Driver interrupt handlers. */ /*===========================================================================*/ #if USE_MSP430_USART0 || defined(__DOXYGEN__) @@ -218,7 +226,7 @@ CH_IRQ_HANDLER(USART1RX_VECTOR) { #endif /* USE_MSP430_USART1 */ /*===========================================================================*/ -/* Low Level Driver exported functions. */ +/* Driver exported functions. */ /*===========================================================================*/ /** diff --git a/os/hal/platforms/MSP430/serial_lld.h b/os/hal/platforms/MSP430/serial_lld.h index e872ee240..fa56d32d8 100644 --- a/os/hal/platforms/MSP430/serial_lld.h +++ b/os/hal/platforms/MSP430/serial_lld.h @@ -29,6 +29,10 @@ #if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) +/*===========================================================================*/ +/* Driver constants. */ +/*===========================================================================*/ + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -40,7 +44,7 @@ * @note The default is 32 bytes for both the transmission and receive buffers. */ #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 32 +#define SERIAL_BUFFERS_SIZE 32 #endif /** @@ -49,7 +53,7 @@ * this speed. */ #if !defined(DEFAULT_USART_BITRATE) || defined(__DOXYGEN__) -#define DEFAULT_USART_BITRATE 38400 +#define DEFAULT_USART_BITRATE 38400 #endif /** @@ -58,7 +62,7 @@ * @note The default is @p TRUE. */ #if !defined(USE_MSP430_USART0) || defined(__DOXYGEN__) -#define USE_MSP430_USART0 TRUE +#define USE_MSP430_USART0 TRUE #endif /** @@ -67,11 +71,11 @@ * @note The default is @p FALSE. */ #if !defined(USE_MSP430_USART1) || defined(__DOXYGEN__) -#define USE_MSP430_USART1 FALSE +#define USE_MSP430_USART1 FALSE #endif /*===========================================================================*/ -/* Unsupported event flags and custom events. */ +/* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ @@ -116,12 +120,6 @@ struct _serial_driver_data { uint8_t ob[SERIAL_BUFFERS_SIZE]; }; -/** - * @brief Macro for baud rate computation. - * @note Make sure the final baud rate is within tolerance. - */ -#define UBR(b) (SMCLK / (b)) - /** * @brief MSP430 Serial Driver configuration structure. * @details An instance of this structure must be passed to @p sdStart() @@ -133,6 +131,16 @@ typedef struct { uint8_t ctl; } SerialDriverConfig; +/*===========================================================================*/ +/* Driver macros. */ +/*===========================================================================*/ + +/** + * @brief Macro for baud rate computation. + * @note Make sure the final baud rate is within tolerance. + */ +#define UBR(b) (SMCLK / (b)) + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ -- cgit v1.2.3