From e45d7da503c04e6a8b83079b474c222eadfa6818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BF=8E=E6=98=A5?= <44871523+chenyingchun0312@users.noreply.github.com> Date: Wed, 16 Jan 2019 13:21:20 +0800 Subject: [PATCH] Update serial.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "remove #ifdef RT_SERIAL_USING_DMA in rt_serial_open, always check device open dma flag" --- components/drivers/serial/serial.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index c5932df7d9..77f2a645a1 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -566,13 +566,11 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) LOG_D("open serial device: 0x%08x with open flag: 0x%04x", dev, oflag); -#ifdef RT_SERIAL_USING_DMA /* check device flag with the open flag */ if ((oflag & RT_DEVICE_FLAG_DMA_RX) && !(dev->flag & RT_DEVICE_FLAG_DMA_RX)) return -RT_EIO; if ((oflag & RT_DEVICE_FLAG_DMA_TX) && !(dev->flag & RT_DEVICE_FLAG_DMA_TX)) return -RT_EIO; -#endif /* RT_SERIAL_USING_DMA */ if ((oflag & RT_DEVICE_FLAG_INT_RX) && !(dev->flag & RT_DEVICE_FLAG_INT_RX)) return -RT_EIO; if ((oflag & RT_DEVICE_FLAG_INT_TX) && !(dev->flag & RT_DEVICE_FLAG_INT_TX))