kinetis:kinetis_lowputc fix BRFA calculation effecting baudrate

Previous BRFA was not cleared and or-ed into new BRFA, hence
  buadrate was wrong.  Where Baud Rate Fractional Divisor (BRFD)
  UART baud rate = clock / (16 * (SBR + BRFD))
This commit is contained in:
David Sidrane
2018-05-30 06:58:21 -06:00
committed by Gregory Nutt
parent 1c4bdfd8fc
commit 46999f9474
+1 -1
View File
@@ -698,7 +698,7 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
/* Set the BRFA field (retaining other bits in the UARTx_C4 register) */
regval = getreg8(uart_base+KINETIS_UART_C4_OFFSET) & UART_C4_BRFA_MASK;
regval = getreg8(uart_base+KINETIS_UART_C4_OFFSET)& ~UART_C4_BRFA_MASK;
regval |= ((uint8_t)brfa << UART_C4_BRFA_SHIFT) & UART_C4_BRFA_MASK;
putreg8(regval, uart_base+KINETIS_UART_C4_OFFSET);