fix: Fix accidentally close PDMA used by other devices when close the serial port
This commit is contained in:
parent
d321e52412
commit
e0f61010e2
|
@ -803,8 +803,10 @@ static rt_err_t nu_uart_control(struct rt_serial_device *serial, int cmd, void *
|
||||||
rt_hw_interrupt_mask(psNuUart->irqn);
|
rt_hw_interrupt_mask(psNuUart->irqn);
|
||||||
|
|
||||||
#if defined(RT_SERIAL_USING_DMA)
|
#if defined(RT_SERIAL_USING_DMA)
|
||||||
nu_pdma_channel_terminate(psNuUart->pdma_chanid_tx);
|
if (psNuUart->dma_flag != 0) {
|
||||||
nu_pdma_channel_terminate(psNuUart->pdma_chanid_rx);
|
nu_pdma_channel_terminate(psNuUart->pdma_chanid_tx);
|
||||||
|
nu_pdma_channel_terminate(psNuUart->pdma_chanid_rx);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Close UART port */
|
/* Close UART port */
|
||||||
|
|
Loading…
Reference in New Issue