You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2024/04/16 13:56:39 UTC

(nuttx) branch master updated: imx9_iomux.h: Fix issues with the header file

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4a82838be7 imx9_iomux.h: Fix issues with the header file
4a82838be7 is described below

commit 4a82838be7630ec73163314e42235a44fac9031e
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Tue Apr 16 11:59:06 2024 +0300

    imx9_iomux.h: Fix issues with the header file
    
    - Add missing include guard
    - Add missing C++ guard
    - Fix the initialization ordering in IOMUX_PADCFG macro. Why ? Becaused of:
    
    imx9_iomuxc.h:54:3: error: designator order for field 'iomux_padcfg_s::dsyreg' does not match declaration order in 'iomux_padcfg_s'
       54 |   }
          |
---
 arch/arm64/src/imx9/imx9_iomuxc.h | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/src/imx9/imx9_iomuxc.h b/arch/arm64/src/imx9/imx9_iomuxc.h
index 80bacc7e5c..6b9c8617b3 100644
--- a/arch/arm64/src/imx9/imx9_iomuxc.h
+++ b/arch/arm64/src/imx9/imx9_iomuxc.h
@@ -18,6 +18,9 @@
  *
  ****************************************************************************/
 
+#ifndef __ARCH_ARM64_SRC_IMX9_IMX9_IOMUXC_H
+#define __ARCH_ARM64_SRC_IMX9_IMX9_IOMUXC_H
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
@@ -36,10 +39,10 @@
 #define IOMUX_PADCFG(_ctlreg, _mode, _dsyreg, _dsy, _padreg) \
   {                                                          \
     .ctlreg = (_ctlreg),                                     \
-    .mode   = (_mode),                                       \
+    .padreg = (_padreg),                                     \
     .dsyreg = (_dsyreg),                                     \
+    .mode   = (_mode),                                       \
     .dsy    = (_dsy),                                        \
-    .padreg = (_padreg),                                     \
   }
 
 #define IOMUX_CFG(_padcfg, _pad, _mux) \
@@ -81,6 +84,19 @@ struct iomux_cfg_s
 };
 typedef struct iomux_cfg_s iomux_cfg_t;
 
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 /****************************************************************************
  * Name: imx9_iomux_configure
  *
@@ -115,3 +131,9 @@ int imx9_iomux_configure(iomux_cfg_t cfg);
  ****************************************************************************/
 
 int imx9_iomux_gpio(iomux_cfg_t cfg, bool sion);
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+#endif /* __ARCH_ARM64_SRC_IMX9_IMX9_IOMUXC_H */