Skip to content

Commit 6dd17f5

Browse files
committed
MSP430/F2xxx: fix ubr msb byte being hardcoded to zero
1 parent 4ce322b commit 6dd17f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpu/msp430/f2xxx/uart0.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ uart0_init(unsigned long ubr)
146146
UCA0CTL1 |= UCSWRST; /* Hold peripheral in reset state */
147147
UCA0CTL1 |= UCSSEL_2; /* CLK = SMCLK */
148148

149-
UCA0BR0 = ubr; /* 8MHz/115200 = 69 = 0x45 */
150-
UCA0BR1 = 0x00;
149+
UCA0BR0 = ((uint8_t *)&ubr)[0]; /* 8MHz/115200 = 69 = 0x45 */
150+
UCA0BR1 = ((uint8_t *)&ubr)[1];
151151
UCA0MCTL = UCBRS_3; /* Modulation UCBRSx = 3 */
152152

153153
P3DIR &= ~0x20; /* P3.5 = USCI_A0 RXD as input */

0 commit comments

Comments
 (0)