[Serial] BUG Fix: data be send twice in mode that other than polling

This commit is contained in:
heyuanjie87 2014-09-01 23:43:50 +08:00
parent 7bd85ac547
commit 8a44c7dbfb
1 changed files with 365 additions and 363 deletions

View File

@ -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,