From a800493fd838ffc3b92f7052184ea71c2240bf85 Mon Sep 17 00:00:00 2001 From: liang yongxiang Date: Sat, 4 Aug 2018 17:40:42 +0800 Subject: [PATCH] [bsp][imxrt1052-evk] fixed uart bug: lost interrupt configuration when re-configuring uart --- bsp/imxrt1052-evk/drivers/drv_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bsp/imxrt1052-evk/drivers/drv_uart.c b/bsp/imxrt1052-evk/drivers/drv_uart.c index a7f54db375..ca076ab19a 100644 --- a/bsp/imxrt1052-evk/drivers/drv_uart.c +++ b/bsp/imxrt1052-evk/drivers/drv_uart.c @@ -439,6 +439,7 @@ static rt_err_t imxrt_configure(struct rt_serial_device *serial, struct serial_c config.enableRx = true; LPUART_Init(uart->uart_base, &config, GetUartSrcFreq()); + LPUART_EnableInterrupts(uart->uart_base, kLPUART_RxDataRegFullInterruptEnable); return RT_EOK; } @@ -453,15 +454,11 @@ static rt_err_t imxrt_control(struct rt_serial_device *serial, int cmd, void *ar switch (cmd) { case RT_DEVICE_CTRL_CLR_INT: - /* disable interrupt */ - LPUART_DisableInterrupts(uart->uart_base, kLPUART_RxDataRegFullInterruptEnable); /* disable rx irq */ DisableIRQ(uart->irqn); break; case RT_DEVICE_CTRL_SET_INT: - /* enable interrupt */ - LPUART_EnableInterrupts(uart->uart_base, kLPUART_RxDataRegFullInterruptEnable); /* enable rx irq */ EnableIRQ(uart->irqn); break;