Merge pull request #335 from heyuanjie87/ForPullRequest

[Serial] BUG Fix: data be send twice in mode that other than polling
This commit is contained in:
Bernard Xiong 2014-09-02 16:55:52 +08:00
commit be9aa36abf
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)
{
_serial_int_tx(serial, buffer, size);
return _serial_int_tx(serial, buffer, size);
}
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);
}
}
static rt_err_t rt_serial_control(struct rt_device *dev,