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

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

commit a75d90576079398b99b0ad89c132966f0765c66f
Author: Masayuki Ishikawa <[email protected]>
AuthorDate: Mon Feb 28 10:53:59 2022 +0900

    arch: imx6: Refactor imx_lowputc()
    
    Summary:
    - Remove '\n' -> '\r\n' conversion
    - Remove waiting for FIFO empty after sending a character
    - Remove CONFIG_DEBUG_FEATURES
    
    Impact:
    - None
    
    Testing:
    - Tested with sabre-6quad:netknsh (not merged yet)
    
    Signed-off-by: Masayuki Ishikawa <[email protected]>
---
 arch/arm/src/imx6/imx_lowputc.c | 23 +----------------------
 arch/arm/src/imx6/imx_lowputc.h |  4 +---
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/arch/arm/src/imx6/imx_lowputc.c b/arch/arm/src/imx6/imx_lowputc.c
index ad39c39..5fa9b0c 100644
--- a/arch/arm/src/imx6/imx_lowputc.c
+++ b/arch/arm/src/imx6/imx_lowputc.c
@@ -571,7 +571,7 @@ int imx_uart_configure(uint32_t base, FAR const struct 
uart_config_s *config)
  *
  ****************************************************************************/
 
-#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES)
+#ifdef IMX_HAVE_UART
 void imx_lowputc(int ch)
 {
   /* Poll the TX fifo trigger level bit of the UART status register. When the
@@ -585,29 +585,8 @@ void imx_lowputc(int ch)
    * return
    */
 
-  if (ch == '\n')
-    {
-      /* Send the carrage return by writing it into the UART_TXD register. */
-
-      putreg32((uint32_t)'\r', IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
-
-      /* Wait for the tranmsit register to be emptied. When the TXFE bit is
-       * non-zero, the TX Buffer FIFO is empty.
-       */
-
-      while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) &
-              UART_USR2_TXFE) == 0);
-    }
-
   /* Send the character by writing it into the UART_TXD register. */
 
   putreg32((uint32_t)ch, IMX_CONSOLE_VBASE + UART_TXD_OFFSET);
-
-  /* Wait for the tranmsit register to be emptied. When the TXFE bit is
-   * non-zero, the TX Buffer FIFO is empty.
-   */
-
-  while ((getreg32(IMX_CONSOLE_VBASE + UART_USR2_OFFSET) &
-          UART_USR2_TXFE) == 0);
 }
 #endif
diff --git a/arch/arm/src/imx6/imx_lowputc.h b/arch/arm/src/imx6/imx_lowputc.h
index 265e119..df81bc8 100644
--- a/arch/arm/src/imx6/imx_lowputc.h
+++ b/arch/arm/src/imx6/imx_lowputc.h
@@ -91,10 +91,8 @@ int imx_uart_configure(uint32_t base,
  *
  ****************************************************************************/
 
-#if defined(IMX_HAVE_UART) && defined(CONFIG_DEBUG_FEATURES)
+#ifdef IMX_HAVE_UART
 void imx_lowputc(int ch);
-#else
-#  define imx_lowputc(ch)
 #endif
 
 #endif /* __ARCH_ARM_SRC_IMX6_IMX_LOWPUTC_H */

Reply via email to