mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 02:27:10 +08:00
Update drv_uart.c
fix indentataions
This commit is contained in:
parent
0fc2b13b45
commit
0fc2211c77
@ -47,16 +47,17 @@ static rt_err_t ls2k_uart_set_buad(struct rt_serial_device *serial,struct serial
|
||||
RT_ASSERT(cfg != RT_NULL);
|
||||
|
||||
uart_dev = (struct rt_uart_ls2k *)serial->parent.user_data;
|
||||
uint64_t brtc = (125000000U) / (16*(cfg->baud_rate));
|
||||
uint64_t brtc = (125000000U) / (16*(cfg->baud_rate));
|
||||
UART_LCR(uart_dev->base)=0x80; // Activate buadcfg
|
||||
UART_LSB(uart_dev->base)= brtc & 0xff;
|
||||
UART_MSB(uart_dev->base)= brtc >> 8;
|
||||
|
||||
if(((((short)UART_MSB(uart_dev->base))<<8) | UART_LSB(uart_dev->base)) != brtc) ret=RT_ERROR;
|
||||
if(((((short)UART_MSB(uart_dev->base))<<8) | UART_LSB(uart_dev->base)) != brtc)
|
||||
ret=RT_ERROR;
|
||||
|
||||
UART_LCR(uart_dev->base)= CFCR_8BITS;// Back to normal
|
||||
UART_MCR(uart_dev->base)= MCR_IENABLE/* | MCR_DTR | MCR_RTS*/;
|
||||
UART_IER(uart_dev->base) = 0;
|
||||
UART_MCR(uart_dev->base)= MCR_IENABLE/* | MCR_DTR | MCR_RTS*/;
|
||||
UART_IER(uart_dev->base) = 0;
|
||||
}
|
||||
static rt_err_t ls2k_uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user