diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-13 01:42:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-13 01:42:21 +0000 |
commit | 3e81596316b5ba875b0521406630dbe49b063709 (patch) | |
tree | 21a4d5fd5b316a2f1c376d2df2eae282c04307b3 /nuttx/arch/avr/src/at90usb | |
parent | a38027207ae9cf3689a7e9a782fa954cb1df3ea6 (diff) | |
download | px4-nuttx-3e81596316b5ba875b0521406630dbe49b063709.tar.gz px4-nuttx-3e81596316b5ba875b0521406630dbe49b063709.tar.bz2 px4-nuttx-3e81596316b5ba875b0521406630dbe49b063709.zip |
Fix AVR uart bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3700 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/avr/src/at90usb')
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c b/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c index 053b053ca..5360eb44d 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_lowconsole.c @@ -198,32 +198,33 @@ void usart1_configure(void) /* Select parity */ #if CONFIG_USART1_PARITY == 1 - ucsr1c |= (UPM11 | UPM10); /* Odd parity */ + ucsr1c |= ((1 << UPM11) | (1 << UPM10)); /* Odd parity */ #else - ucsr1c |= UPM11; /* Even parity */ + ucsr1c |= (1 << UPM11); /* Even parity */ #endif /* 1 or 2 stop bits */ #if defined(CONFIG_USART1_2STOP) && CONFIG_USART1_2STOP > 0 - ucsr1c |= USBS1; /* Two stop bits */ + ucsr1c |= (1 << USBS1); /* Two stop bits */ #endif /* Word size */ #if CONFIG_USART1_BITS == 5 #elif CONFIG_USART1_BITS == 6 - ucsr1c |= UCSZ10; + ucsr1c |= (1 << UCSZ10); #elif CONFIG_USART1_BITS == 7 - ucsr1c |= UCSZ11; + ucsr1c |= (1 << UCSZ11); #elif CONFIG_USART1_BITS == 8 - ucsr1c |= (UCSZ10 | UCSZ11); + ucsr1c |= ((1 << UCSZ10) | (1 << UCSZ11)); #elif CONFIG_USART1_BITS == 9 - ucsr1c |= (UCSZ10 | UCSZ11); - ucsr1b |= UCSZ12; + ucsr1c |= ((1 << UCSZ10) | (1 << UCSZ11)); + ucsr1b |= (1 << UCSZ12); #else # error "Unsupported word size" #endif + UCSR1B = ucsr1b; UCSR1C = ucsr1c; @@ -239,7 +240,7 @@ void usart1_configure(void) * an output regardless of the value of DDD3. */ - DDRD |= (1 << 3); /* Force Port D pin 3 to be an output */ + DDRD |= (1 << 3); /* Force Port D pin 3 to be an output -- Shouldn't be necessary */ PORTD |= (1 << 2); /* Set pull-up on port D pin 2 */ /* Set the baud rate divisor */ |