You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/28 13:51:14 UTC

[incubator-nuttx] branch pr396 updated: sama5/serial: correct usage of USE_SERIALDRIVER and USE_EARLYSERIALINIT

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

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


The following commit(s) were added to refs/heads/pr396 by this push:
     new 4081287  sama5/serial: correct usage of USE_SERIALDRIVER and USE_EARLYSERIALINIT
4081287 is described below

commit 40812873b721c484d6cb449430cc60e4a1dff54c
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Fri Feb 28 16:20:32 2020 +0800

    sama5/serial: correct usage of USE_SERIALDRIVER and USE_EARLYSERIALINIT
    
    Also fix the following build warning:
    chip/sam_serialinit.c: In function 'sam_earlyserialinit':
    chip/sam_serialinit.c:71:4: warning: implicit declaration of function 'uart_earlyserialinit'; did you mean 'sam_earlyserialinit'? [-Wimplicit-function-declaration]
       71 |    uart_earlyserialinit();
          |    ^~~~~~~~~~~~~~~~~~~~
          |    sam_earlyserialinit
    
    Change-Id: I93adc5be739c222482b552b6e143e44c8c047794
    Signed-off-by: liuhaitao <li...@xiaomi.com>
---
 arch/arm/src/sama5/sam_flexcom_serial.c | 3 +++
 arch/arm/src/sama5/sam_serial.c         | 3 +++
 arch/arm/src/sama5/sam_serial.h         | 4 ++--
 arch/arm/src/sama5/sam_serialinit.c     | 3 +++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/src/sama5/sam_flexcom_serial.c b/arch/arm/src/sama5/sam_flexcom_serial.c
index b9645c3..06d937b 100644
--- a/arch/arm/src/sama5/sam_flexcom_serial.c
+++ b/arch/arm/src/sama5/sam_flexcom_serial.c
@@ -1124,6 +1124,8 @@ static bool flexus_txempty(struct uart_dev_s *dev)
  * Public Functions
  ****************************************************************************/
 
+#ifdef USE_EARLYSERIALINIT
+
 /****************************************************************************
  * Name: flexus_earlyserialinit
  *
@@ -1195,6 +1197,7 @@ void flexus_earlyserialinit(void)
   flexus_setup(&CONSOLE_DEV);
 #endif
 }
+#endif
 
 /****************************************************************************
  * Name: flexus_serialinit
diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c
index 0338862..a2f1f17 100644
--- a/arch/arm/src/sama5/sam_serial.c
+++ b/arch/arm/src/sama5/sam_serial.c
@@ -1576,6 +1576,8 @@ static bool up_txempty(struct uart_dev_s *dev)
  * Public Functions
  ****************************************************************************/
 
+#ifdef USE_EARLYSERIALINIT
+
 /****************************************************************************
  * Name: uart_earlyserialinit
  *
@@ -1632,6 +1634,7 @@ void uart_earlyserialinit(void)
   up_setup(&CONSOLE_DEV);
 #endif
 }
+#endif
 
 /****************************************************************************
  * Name: uart_serialinit
diff --git a/arch/arm/src/sama5/sam_serial.h b/arch/arm/src/sama5/sam_serial.h
index 63cb5ab..bf39c73 100644
--- a/arch/arm/src/sama5/sam_serial.h
+++ b/arch/arm/src/sama5/sam_serial.h
@@ -127,7 +127,7 @@ void flexus_earlyserialinit(void);
  *
  ****************************************************************************/
 
-#if defined(SAMA5_HAVE_UART) || defined(SAMA5_HAVE_USART)
+#if defined(USE_SERIALDRIVER) && (defined(SAMA5_HAVE_UART) || defined(SAMA5_HAVE_USART))
 void uart_serialinit(void);
 #endif
 
@@ -140,7 +140,7 @@ void uart_serialinit(void);
  *
  ****************************************************************************/
 
-#if defined(USE_EARLYSERIALINIT) && defined(SAMA5_HAVE_FLEXCOM_USART)
+#if defined(USE_SERIALDRIVER) && defined(SAMA5_HAVE_FLEXCOM_USART)
 void flexus_serialinit(void);
 #endif
 
diff --git a/arch/arm/src/sama5/sam_serialinit.c b/arch/arm/src/sama5/sam_serialinit.c
index 59c25ed..2ff5888 100644
--- a/arch/arm/src/sama5/sam_serialinit.c
+++ b/arch/arm/src/sama5/sam_serialinit.c
@@ -49,6 +49,8 @@
  * Public Functions
  ****************************************************************************/
 
+#ifdef USE_EARLYSERIALINIT
+
 /****************************************************************************
  * Name: sam_earlyserialinit
  *
@@ -77,6 +79,7 @@ void sam_earlyserialinit(void)
   flexus_earlyserialinit();
 #endif
 }
+#endif
 
 /****************************************************************************
  * Name: up_serialinit