diff --git a/drivers/bl702_driver/hal_drv/inc/hal_uart.h b/drivers/bl702_driver/hal_drv/inc/hal_uart.h index e90cee43..aafa7f1d 100644 --- a/drivers/bl702_driver/hal_drv/inc/hal_uart.h +++ b/drivers/bl702_driver/hal_drv/inc/hal_uart.h @@ -26,6 +26,8 @@ #include "drv_device.h" #include "bl702_config.h" +#define UART_FIFO_LEN 128 + #define DEVICE_CTRL_UART_GET_TX_FIFO 0x10 #define DEVICE_CTRL_UART_GET_RX_FIFO 0x11 diff --git a/drivers/bl702_driver/hal_drv/src/hal_uart.c b/drivers/bl702_driver/hal_drv/src/hal_uart.c index 4c78e957..09a9eb67 100644 --- a/drivers/bl702_driver/hal_drv/src/hal_uart.c +++ b/drivers/bl702_driver/hal_drv/src/hal_uart.c @@ -74,12 +74,15 @@ int uart_open(struct device *dev, uint16_t oflag) uart_cfg.txLinMode = UART_TX_LINMODE_ENABLE; uart_cfg.rxLinMode = UART_RX_LINMODE_ENABLE; uart_cfg.txBreakBitCnt = UART_TX_BREAKBIT_CNT; + uart_cfg.rxDeglitch = ENABLE; /* uart init with default configuration */ UART_Init(uart_device->id, &uart_cfg); /* Enable tx free run mode */ UART_TxFreeRun(uart_device->id, ENABLE); + /*set de-glitch function cycle count value*/ + UART_SetDeglitchCount(uart_device->id, 2); /* Set rx time-out value */ UART_SetRxTimeoutValue(uart_device->id, UART_DEFAULT_RTO_TIMEOUT);