Skip to content

Commit

Permalink
imx9_iomux.h: Fix issues with the header file
Browse files Browse the repository at this point in the history
- 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 |   }
      |
  • Loading branch information
pussuw authored and acassis committed Apr 16, 2024
1 parent 9beb73d commit 4a82838
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions arch/arm64/src/imx9/imx9_iomuxc.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*
****************************************************************************/

#ifndef __ARCH_ARM64_SRC_IMX9_IMX9_IOMUXC_H
#define __ARCH_ARM64_SRC_IMX9_IMX9_IOMUXC_H

/****************************************************************************
* Included Files
****************************************************************************/
Expand All @@ -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) \
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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 */

0 comments on commit 4a82838

Please sign in to comment.