Skip to content

Commit

Permalink
correct baud rate formula
Browse files Browse the repository at this point in the history
  • Loading branch information
M0stafaRady authored Jan 19, 2025
1 parent b231f14 commit 9854fc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fw/EF_UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ EF_DRIVER_STATUS UART_Init(EF_UART_TYPE_PTR uart, uint32_t baud_rate, uint32_t b
}

// Calculate and set the prescaler
uint32_t prescaler = (bus_clock / (baud_rate * (uint32_t)16)) - (uint32_t)1;
uint32_t prescaler = (bus_clock / (baud_rate * (uint32_t)8)) - (uint32_t)1;
if (status == EF_DRIVER_OK) {status = EF_UART_setPrescaler(uart, prescaler);} else {}

// Configure data bits, stop bits, and parity
Expand Down

0 comments on commit 9854fc1

Please sign in to comment.