Fixed bug introduced by bug #951 fix.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12084 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
0f05bc3491
commit
c2477148f0
|
@ -115,8 +115,10 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
|||
/* Correcting USARTDIV when oversampling by 8 instead of 16.
|
||||
Fraction is still 4 bits wide, but only lower 3 bits used.
|
||||
Mantissa is doubled, but Fraction is left the same.*/
|
||||
#if defined(USART_CR1_OVER8)
|
||||
if (config->cr1 & USART_CR1_OVER8)
|
||||
fck = ((fck & ~7) * 2) | (fck & 7);
|
||||
#endif
|
||||
u->BRR = fck;
|
||||
|
||||
/* Note that some bits are enforced.*/
|
||||
|
|
|
@ -216,8 +216,10 @@ static void usart_start(UARTDriver *uartp) {
|
|||
/* Correcting USARTDIV when oversampling by 8 instead of 16.
|
||||
Fraction is still 4 bits wide, but only lower 3 bits used.
|
||||
Mantissa is doubled, but Fraction is left the same.*/
|
||||
if (uartp->config->cr1 & USART_CR1_OVER8)
|
||||
#if defined(USART_CR1_OVER8)
|
||||
if (config->cr1 & USART_CR1_OVER8)
|
||||
fck = ((fck & ~7) * 2) | (fck & 7);
|
||||
#endif
|
||||
u->BRR = fck;
|
||||
|
||||
/* Resetting eventual pending status flags.*/
|
||||
|
|
Loading…
Reference in New Issue