[rtems commit] bsp/tms570: correct baudrate calculation.

Pavel Pisa ppisa at rtems.org
Wed Nov 14 22:49:14 UTC 2018


Module:    rtems
Branch:    master
Commit:    5247a21436976e5ec745b237fd38bb3817cdb117
Changeset: http://git.rtems.org/rtems/commit/?id=5247a21436976e5ec745b237fd38bb3817cdb117

Author:    Pavel Pisa <pisa at cmp.felk.cvut.cz>
Date:      Wed Nov 14 23:48:56 2018 +0100

bsp/tms570: correct baudrate calculation.

---

 bsps/arm/tms570/console/tms570-sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/arm/tms570/console/tms570-sci.c b/bsps/arm/tms570/console/tms570-sci.c
index 48986e9..9f16c42 100644
--- a/bsps/arm/tms570/console/tms570-sci.c
+++ b/bsps/arm/tms570/console/tms570-sci.c
@@ -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;



More information about the vc mailing list