mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
xtensa/esp32: Fix ESP32 serial UART tx ready check error
This commit is contained in:
committed by
Abdelatif Guettouche
parent
7d33f73e27
commit
fadae0bf39
@@ -1154,10 +1154,13 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
|
|
||||||
static bool esp32_txready(struct uart_dev_s *dev)
|
static bool esp32_txready(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
|
uint32_t txcnt;
|
||||||
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
||||||
|
|
||||||
return ((esp32_serialin(priv, UART_STATUS_OFFSET) & UART_TXFIFO_CNT_M) <
|
txcnt = (esp32_serialin(priv, UART_STATUS_OFFSET) >> UART_TXFIFO_CNT_S) &
|
||||||
0x7f);
|
UART_TXFIFO_CNT_V;
|
||||||
|
|
||||||
|
return txcnt < 0x7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user