[Serial] BUG Fix: data be send twice in mode that other than polling
This commit is contained in:
parent
7bd85ac547
commit
8a44c7dbfb
|
@ -431,14 +431,16 @@ static rt_size_t rt_serial_write(struct rt_device *dev,
|
||||||
|
|
||||||
if (dev->open_flag & RT_DEVICE_FLAG_INT_TX)
|
if (dev->open_flag & RT_DEVICE_FLAG_INT_TX)
|
||||||
{
|
{
|
||||||
_serial_int_tx(serial, buffer, size);
|
return _serial_int_tx(serial, buffer, size);
|
||||||
}
|
}
|
||||||
else if (dev->open_flag & RT_DEVICE_FLAG_DMA_TX)
|
else if (dev->open_flag & RT_DEVICE_FLAG_DMA_TX)
|
||||||
{
|
{
|
||||||
_serial_dma_tx(serial, buffer, size);
|
return _serial_dma_tx(serial, buffer, size);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return _serial_poll_tx(serial, buffer, size);
|
return _serial_poll_tx(serial, buffer, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static rt_err_t rt_serial_control(struct rt_device *dev,
|
static rt_err_t rt_serial_control(struct rt_device *dev,
|
||||||
|
|
Loading…
Reference in New Issue