mirror of https://github.com/Desuuuu/klipper.git
lpc176x: Fix serial ordering of initialization
The serial device needs to be enabled before setting the DLAB bit. This prevented UART3 from working. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
682d38f590
commit
7ce409d7a5
|
@ -75,8 +75,8 @@ void
|
|||
serial_init(void)
|
||||
{
|
||||
// Setup baud
|
||||
LPC_UARTx->LCR = (1<<7); // set DLAB bit
|
||||
enable_pclock(PCLK_UARTx);
|
||||
LPC_UARTx->LCR = (1<<7); // set DLAB bit
|
||||
uint32_t pclk = get_pclock_frequency(PCLK_UARTx);
|
||||
uint32_t div = pclk / (CONFIG_SERIAL_BAUD * 16);
|
||||
LPC_UARTx->DLL = div & 0xff;
|
||||
|
|
Loading…
Reference in New Issue