xtensa/esp32: Fix ESP32 serial UART tx ready check error

This commit is contained in:
Dong Heng 2021-01-04 10:55:50 +08:00 committed by Abdelatif Guettouche
parent 7d33f73e27
commit fadae0bf39
1 changed files with 5 additions and 2 deletions

View File

@ -1154,10 +1154,13 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable)
static bool esp32_txready(struct uart_dev_s *dev)
{
uint32_t txcnt;
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
return ((esp32_serialin(priv, UART_STATUS_OFFSET) & UART_TXFIFO_CNT_M) <
0x7f);
txcnt = (esp32_serialin(priv, UART_STATUS_OFFSET) >> UART_TXFIFO_CNT_S) &
UART_TXFIFO_CNT_V;
return txcnt < 0x7f;
}
/****************************************************************************