mirror of https://github.com/ArduPilot/ardupilot
FastSerial Fix
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1826 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
a2e02c4a02
commit
bff541a8a6
|
@ -112,12 +112,13 @@ void FastSerial::begin(long baud, unsigned int rxSpace, unsigned int txSpace)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (use_u2x) {
|
if (use_u2x) {
|
||||||
|
*_ucsra = 1 << _u2x;
|
||||||
ubrr = (F_CPU / 4 / baud - 1) / 2;
|
ubrr = (F_CPU / 4 / baud - 1) / 2;
|
||||||
} else {
|
} else {
|
||||||
|
*_ucsra = 0;
|
||||||
ubrr = (F_CPU / 8 / baud - 1) / 2;
|
ubrr = (F_CPU / 8 / baud - 1) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
*_ucsra = use_u2x ? _BV(_u2x) : 0;
|
|
||||||
*_ubrrh = ubrr >> 8;
|
*_ubrrh = ubrr >> 8;
|
||||||
*_ubrrl = ubrr;
|
*_ubrrl = ubrr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue