forked from Archive/PX4-Autopilot
px4io_serial: ensure TX DMA is stopped if exiting early on stream error
- otherwise the next retry can happen quickly enough that dma setup hangs waiting for the stream
This commit is contained in:
parent
6cb0259b79
commit
7925787f62
|
@ -328,6 +328,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
|
|||
if (ret == OK) {
|
||||
/* check for DMA errors */
|
||||
if (_rx_dma_status & DMA_STATUS_TEIF) {
|
||||
// stream transfer error, ensure TX DMA is also stopped before exiting early
|
||||
stm32_dmastop(_tx_dma);
|
||||
perf_count(_pc_dmaerrs);
|
||||
ret = -EIO;
|
||||
break;
|
||||
|
|
|
@ -373,6 +373,8 @@ ArchPX4IOSerial::_bus_exchange(IOPacket *_packet)
|
|||
if (ret == OK) {
|
||||
/* check for DMA errors */
|
||||
if (_rx_dma_status & DMA_STATUS_TEIF) {
|
||||
// stream transfer error, ensure TX DMA is also stopped before exiting early
|
||||
stm32_dmastop(_tx_dma);
|
||||
perf_count(_pc_dmaerrs);
|
||||
ret = -EIO;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue