pl011: Fix baud divisor (correctly this time)
* Order of operations error, seen after writing a quick test app.. sorry for spam
This commit is contained in:
@@ -79,8 +79,8 @@ UartPL011::InitPort(uint32 baud)
|
|||||||
// Calculate baud divisor
|
// Calculate baud divisor
|
||||||
uint32 baudDivisor = BOARD_UART_CLOCK / (16 * baud);
|
uint32 baudDivisor = BOARD_UART_CLOCK / (16 * baud);
|
||||||
uint32 remainder = BOARD_UART_CLOCK % (16 * baud);
|
uint32 remainder = BOARD_UART_CLOCK % (16 * baud);
|
||||||
uint32 baudFractional = ((8 * remainder) / baud) >> 1
|
uint32 baudFractional = ((8 * remainder) / BAUD >> 1)
|
||||||
+ ((8 * remainder) / baud) & 1;
|
+ ((8 * remainder) / BAUD & 1);
|
||||||
|
|
||||||
// Disable UART
|
// Disable UART
|
||||||
Disable();
|
Disable();
|
||||||
|
|||||||
Reference in New Issue
Block a user