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:
Alexander von Gluck IV 2012-05-14 13:42:35 -05:00
parent 96ca76504f
commit b0df02004f

View File

@ -79,8 +79,8 @@ UartPL011::InitPort(uint32 baud)
// Calculate baud divisor
uint32 baudDivisor = BOARD_UART_CLOCK / (16 * baud);
uint32 remainder = BOARD_UART_CLOCK % (16 * baud);
uint32 baudFractional = ((8 * remainder) / baud) >> 1
+ ((8 * remainder) / baud) & 1;
uint32 baudFractional = ((8 * remainder) / BAUD >> 1)
+ ((8 * remainder) / BAUD & 1);
// Disable UART
Disable();