bsp/tms570: correct baudrate calculation.

This commit is contained in:
Pavel Pisa
2018-11-14 23:48:56 +01:00
parent aefd4a2dee
commit 5247a21436

View File

@@ -311,7 +311,7 @@ bool tms570_sci_set_attributes(
/* Apply baudrate to the hardware */
baudrate *= 2 * 16;
bauddiv = (BSP_PLL_OUT_CLOCK + baudrate / 2) / baudrate;
ctx->regs->BRS = bauddiv;
ctx->regs->BRS = bauddiv? bauddiv - 1: 0;
ctx->regs->GCR1 |= TMS570_SCI_GCR1_SWnRST | TMS570_SCI_GCR1_TXENA |
TMS570_SCI_GCR1_RXENA;