You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2021/01/04 08:20:04 UTC

[incubator-nuttx] branch master updated: xtensa/esp32: Fix ESP32 serial UART tx ready check error

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new fadae0b  xtensa/esp32: Fix ESP32 serial UART tx ready check error
fadae0b is described below

commit fadae0bf393ce45416b6c75e5d3506f90cba88e9
Author: Dong Heng <do...@espressif.com>
AuthorDate: Mon Jan 4 10:55:50 2021 +0800

    xtensa/esp32: Fix ESP32 serial UART tx ready check error
---
 arch/xtensa/src/esp32/esp32_serial.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_serial.c b/arch/xtensa/src/esp32/esp32_serial.c
index ddaa6ec..80b0acc 100644
--- a/arch/xtensa/src/esp32/esp32_serial.c
+++ b/arch/xtensa/src/esp32/esp32_serial.c
@@ -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;
 }
 
 /****************************************************************************