mirror of https://github.com/rusefi/ChibiOS.git
USARTv1 regression on STM32F1xx.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13898 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
417d450e0b
commit
7064624f81
|
@ -114,11 +114,13 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
|||
|
||||
brr = (uint32_t)(sdp->clock / config->speed);
|
||||
|
||||
#if defined(USART_CR1_OVER8)
|
||||
/* Correcting BRR value 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 (config->cr1 & USART_CR1_OVER8)
|
||||
brr = ((brr & ~7) * 2) | (brr & 7);
|
||||
#endif
|
||||
|
||||
osalDbgAssert(brr < 0x10000, "invalid BRR value");
|
||||
|
||||
|
|
Loading…
Reference in New Issue