diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-13 00:06:09 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-13 00:06:09 +0000 |
commit | a38027207ae9cf3689a7e9a782fa954cb1df3ea6 (patch) | |
tree | dcd04e4ae64077dc4e8fa222a61bc9dcc067c7a1 /nuttx/arch/avr/src/atmega/atmega_lowconsole.c | |
parent | 40468f1d1ed8466265ea8680ed2de38ef4f89fca (diff) | |
download | px4-nuttx-a38027207ae9cf3689a7e9a782fa954cb1df3ea6.tar.gz px4-nuttx-a38027207ae9cf3689a7e9a782fa954cb1df3ea6.tar.bz2 px4-nuttx-a38027207ae9cf3689a7e9a782fa954cb1df3ea6.zip |
Add hello configuratin for AVR
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3699 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/avr/src/atmega/atmega_lowconsole.c')
-rw-r--r-- | nuttx/arch/avr/src/atmega/atmega_lowconsole.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/nuttx/arch/avr/src/atmega/atmega_lowconsole.c b/nuttx/arch/avr/src/atmega/atmega_lowconsole.c index af558faa0..e746f6e5d 100644 --- a/nuttx/arch/avr/src/atmega/atmega_lowconsole.c +++ b/nuttx/arch/avr/src/atmega/atmega_lowconsole.c @@ -55,7 +55,7 @@ * Private Definitions ******************************************************************************/ -/* USART0 Baud rate settings for normal and double speed settings */ +/* USART0 Baud rate settings for normal and double speed modes */ #define AVR_NORMAL_UBRR0 \ (((((BOARD_CPU_CLOCK / 16) + (CONFIG_USART0_BAUD / 2)) / (CONFIG_USART0_BAUD)) - 1) @@ -99,16 +99,23 @@ # define AVR_UBRR0 AVR_DBLSPEED_UBRR0 # define UART0_DOUBLE_SPEED 1 # endif -#else +#elif BOARD_CPU_CLOCK <= 16000000 # if CONFIG_USART0_BAUD <= 38400 # define AVR_UBRR0 AVR_NORMAL_UBRR0 # else # define AVR_UBRR0 AVR_DBLSPEED_UBRR0 # define UART0_DOUBLE_SPEED 1 # endif +#else +# if CONFIG_USART0_BAUD <= 57600 +# define AVR_UBRR0 AVR_NORMAL_UBRR0 +# else +# define AVR_UBRR0 AVR_DBLSPEED_UBRR0 +# define UART0_DOUBLE_SPEED 1 +# endif #endif -/* USART1 Baud rate settings for normal and double speed settings */ +/* USART1 Baud rate settings for normal and double speed modes */ #define AVR_NORMAL_UBRR1 \ ((((BOARD_CPU_CLOCK / 16) + (CONFIG_USART1_BAUD / 2)) / (CONFIG_USART1_BAUD)) - 1) @@ -152,13 +159,20 @@ # define AVR_UBRR1 AVR_DBLSPEED_UBRR1 # define UART1_DOUBLE_SPEED 1 # endif -#else +#elif BOARD_CPU_CLOCK <= 16000000 # if CONFIG_USART1_BAUD <= 38400 # define AVR_UBRR1 AVR_NORMAL_UBRR1 # else # define AVR_UBRR1 AVR_DBLSPEED_UBRR1 # define UART1_DOUBLE_SPEED 1 # endif +#else +# if CONFIG_USART1_BAUD <= 57600 +# define AVR_UBRR1 AVR_NORMAL_UBRR1 +# else +# define AVR_UBRR1 AVR_DBLSPEED_UBRR1 +# define UART1_DOUBLE_SPEED 1 +# endif #endif /****************************************************************************** |