stm32: serial use 115200 baud rate

115200 is a much more sane "default" than 38400.
Instead of a mix of 38400 and 115200, just use 115200 in all places.
There's no reason for modern 32bit cpus to be using such old slow
baudrates.

Tested on f1, f4, l1.  Replaced some old f1 code that predated some
library support code for this.
This commit is contained in:
Karl Palsson
2019-06-02 16:08:13 +00:00
parent e0f377fec0
commit be1d296e2f
32 changed files with 37 additions and 45 deletions

View File

@@ -44,11 +44,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
/* Setup UART parameters. */
// usart_set_baudrate(USART1, 38400);
/* TODO usart_set_baudrate() doesn't support 24MHz clock (yet). */
/* This is the equivalent: */
USART_BRR(USART1) = (uint16_t)((24000000 << 4) / (38400 * 16));
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);