arch/sim: Replace uart_[xmit|recv]chars_dma with uart_dma[txavail|rxfree]
to follow the original dma design Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
694c0f0b7f
commit
add569d0e5
|
@ -421,19 +421,19 @@ static void tty_work(void *arg)
|
|||
return;
|
||||
}
|
||||
|
||||
if (priv->txint && host_uart_checkout(dev->isconsole ? 1 : priv->fd))
|
||||
if (priv->txint)
|
||||
{
|
||||
#ifdef CONFIG_SIM_UART_DMA
|
||||
uart_xmitchars_dma(dev);
|
||||
uart_dmatxavail(dev);
|
||||
#else
|
||||
uart_xmitchars(dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (priv->rxint && host_uart_checkin(priv->fd))
|
||||
if (priv->rxint)
|
||||
{
|
||||
#ifdef CONFIG_SIM_UART_DMA
|
||||
uart_recvchars_dma(dev);
|
||||
uart_dmarxfree(dev);
|
||||
#else
|
||||
uart_recvchars(dev);
|
||||
#endif
|
||||
|
@ -511,6 +511,10 @@ static bool tty_rxflowcontrol(struct uart_dev_s *dev,
|
|||
|
||||
static void tty_dmatxavail(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
if (uart_txready(dev))
|
||||
{
|
||||
uart_xmitchars_dma(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -557,6 +561,10 @@ static void tty_dmasend(FAR struct uart_dev_s *dev)
|
|||
|
||||
static void tty_dmarxfree(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
if (uart_rxavailable(dev))
|
||||
{
|
||||
uart_recvchars_dma(dev);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -730,4 +738,3 @@ int up_putc(int ch)
|
|||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue