freertos: weekly rls 2024.06.6
-0cb268, Round UART baud rate divisor to nearest integer. Change-Id: Ib91a06191ca8c974438e7bcb5943f6abaf7ebb6e
This commit is contained in:
committed by
carbon
parent
869fc0a0e2
commit
5ec5f7889a
@ -6,7 +6,7 @@ static struct dw_regs *uart = 0;
|
||||
|
||||
void hal_uart_init(device_uart dev_uart, int baudrate, int uart_clock)
|
||||
{
|
||||
int divisor = uart_clock / (16 * baudrate);
|
||||
int divisor = (uart_clock + 8 * baudrate) / (16 * baudrate);
|
||||
switch (dev_uart) {
|
||||
case UART0:
|
||||
uart = (struct dw_regs *)UART0_BASE;
|
||||
|
||||
Reference in New Issue
Block a user