Skip to content

Commit e45d7da

Browse files
Update serial.c
"remove #ifdef RT_SERIAL_USING_DMA in rt_serial_open, always check device open dma flag"
1 parent e9c80c3 commit e45d7da

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

components/drivers/serial/serial.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,11 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
566566

567567
LOG_D("open serial device: 0x%08x with open flag: 0x%04x",
568568
dev, oflag);
569-
#ifdef RT_SERIAL_USING_DMA
570569
/* check device flag with the open flag */
571570
if ((oflag & RT_DEVICE_FLAG_DMA_RX) && !(dev->flag & RT_DEVICE_FLAG_DMA_RX))
572571
return -RT_EIO;
573572
if ((oflag & RT_DEVICE_FLAG_DMA_TX) && !(dev->flag & RT_DEVICE_FLAG_DMA_TX))
574573
return -RT_EIO;
575-
#endif /* RT_SERIAL_USING_DMA */
576574
if ((oflag & RT_DEVICE_FLAG_INT_RX) && !(dev->flag & RT_DEVICE_FLAG_INT_RX))
577575
return -RT_EIO;
578576
if ((oflag & RT_DEVICE_FLAG_INT_TX) && !(dev->flag & RT_DEVICE_FLAG_INT_TX))

0 commit comments

Comments
 (0)