未验证 提交 d189b686 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #2224 from chenyingchun0312/master

Update 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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册