From bff541a8a694894f5f68307357bb43c7a33defc3 Mon Sep 17 00:00:00 2001 From: "mich146@hotmail.com" Date: Tue, 29 Mar 2011 00:08:27 +0000 Subject: [PATCH] FastSerial Fix git-svn-id: https://arducopter.googlecode.com/svn/trunk@1826 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/FastSerial/FastSerial.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/FastSerial/FastSerial.cpp b/libraries/FastSerial/FastSerial.cpp index d15c0ea925..b4c1cf9cbb 100644 --- a/libraries/FastSerial/FastSerial.cpp +++ b/libraries/FastSerial/FastSerial.cpp @@ -112,12 +112,13 @@ void FastSerial::begin(long baud, unsigned int rxSpace, unsigned int txSpace) #endif if (use_u2x) { + *_ucsra = 1 << _u2x; ubrr = (F_CPU / 4 / baud - 1) / 2; } else { + *_ucsra = 0; ubrr = (F_CPU / 8 / baud - 1) / 2; } - *_ucsra = use_u2x ? _BV(_u2x) : 0; *_ubrrh = ubrr >> 8; *_ubrrl = ubrr; }