commit
d189b686fe
|
@ -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",
|
LOG_D("open serial device: 0x%08x with open flag: 0x%04x",
|
||||||
dev, oflag);
|
dev, oflag);
|
||||||
#ifdef RT_SERIAL_USING_DMA
|
|
||||||
/* check device flag with the open flag */
|
/* check device flag with the open flag */
|
||||||
if ((oflag & RT_DEVICE_FLAG_DMA_RX) && !(dev->flag & RT_DEVICE_FLAG_DMA_RX))
|
if ((oflag & RT_DEVICE_FLAG_DMA_RX) && !(dev->flag & RT_DEVICE_FLAG_DMA_RX))
|
||||||
return -RT_EIO;
|
return -RT_EIO;
|
||||||
if ((oflag & RT_DEVICE_FLAG_DMA_TX) && !(dev->flag & RT_DEVICE_FLAG_DMA_TX))
|
if ((oflag & RT_DEVICE_FLAG_DMA_TX) && !(dev->flag & RT_DEVICE_FLAG_DMA_TX))
|
||||||
return -RT_EIO;
|
return -RT_EIO;
|
||||||
#endif /* RT_SERIAL_USING_DMA */
|
|
||||||
if ((oflag & RT_DEVICE_FLAG_INT_RX) && !(dev->flag & RT_DEVICE_FLAG_INT_RX))
|
if ((oflag & RT_DEVICE_FLAG_INT_RX) && !(dev->flag & RT_DEVICE_FLAG_INT_RX))
|
||||||
return -RT_EIO;
|
return -RT_EIO;
|
||||||
if ((oflag & RT_DEVICE_FLAG_INT_TX) && !(dev->flag & RT_DEVICE_FLAG_INT_TX))
|
if ((oflag & RT_DEVICE_FLAG_INT_TX) && !(dev->flag & RT_DEVICE_FLAG_INT_TX))
|
||||||
|
|
Loading…
Reference in New Issue