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/at90usb | |
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/at90usb')
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c b/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c index eb93dc5e2..053b053ca 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c @@ -56,7 +56,7 @@ * Private Definitions ******************************************************************************/ -/* Baud rate settings for normal and double speed settings */ +/* 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) @@ -100,13 +100,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 /****************************************************************************** @@ -156,8 +163,8 @@ void usart1_reset(void) PORTD &= ~(1 << 2); /* Unconfigure BAUD divisor */ - - UBRR1 = 0; + + UBRR1 = 0; } #endif @@ -237,7 +244,7 @@ void usart1_configure(void) /* Set the baud rate divisor */ - UBRR1 = AVR_UBRR1; + UBRR1 = AVR_UBRR1; } #endif |