1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/lpc1768: fixed UART PCLK selection

This commit is contained in:
Hauke Petersen 2014-12-18 16:20:14 +01:00
parent 695d702b4f
commit 31a6e81bd9

View File

@ -88,11 +88,9 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
return -2;
}
/* power on UART device */
/* power on UART device and select peripheral clock */
UART_0_CLKEN();
/* set peripheral clock to CCLK / 4 */
LPC_SC->PCLKSEL1 &= (0x3 << 18);
UART_0_CLKSEL();
/* set mode to 8N1 and enable access to divisor latch */
UART_0_DEV->LCR = ((0x3 << 0) | (1 << 7));
/* set baud rate registers (fixed for now) */
@ -121,10 +119,9 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
return -2;
}
/* power on UART device */
/* power on UART device and select peripheral clock */
UART_1_CLKEN();
/* set peripheral clock to CCLK / 4 */
LPC_SC->PCLKSEL1 &= (0x3 << 18);
UART_1_CLKSEL();
/* set mode to 8N1 and enable access to divisor latch */
UART_1_DEV->LCR = ((0x3 << 0) | (1 << 7));
/* set baud rate registers (fixed for now) */