Skip to content

Commit

Permalink
sensors: Remove duplicated defnitions from bmi160.h
Browse files Browse the repository at this point in the history
Remove duplicated defnitions from bmi160.h.
  • Loading branch information
SPRESENSE committed Feb 27, 2024
1 parent 1719859 commit d599949
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 38 deletions.
12 changes: 6 additions & 6 deletions boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ int board_bmi160_initialize(int bus);
*
****************************************************************************/

#ifdef CONFIG_SENSORS_BMI160_I2C
#ifdef CONFIG_SENSORS_BMI160_SCU_I2C
int bmi160_init(struct i2c_master_s *dev, int port);
#else /* CONFIG_SENSORS_BMI160_SPI */
#else /* CONFIG_SENSORS_BMI160_SCU_SPI */
int bmi160_init(struct spi_dev_s *dev);
#endif

Expand All @@ -101,10 +101,10 @@ int bmi160_init(struct spi_dev_s *dev);
*
****************************************************************************/

#ifdef CONFIG_SENSORS_BMI160_I2C
#ifdef CONFIG_SENSORS_BMI160_SCU_I2C
int bmi160gyro_register(const char *devpath, int minor,
struct i2c_master_s *dev, int port);
#else /* CONFIG_SENSORS_BMI160_SPI */
#else /* CONFIG_SENSORS_BMI160_SCU_SPI */
int bmi160gyro_register(const char *devpath, int minor,
struct spi_dev_s *dev);
#endif
Expand All @@ -127,10 +127,10 @@ int bmi160gyro_register(const char *devpath, int minor,
*
****************************************************************************/

#ifdef CONFIG_SENSORS_BMI160_I2C
#ifdef CONFIG_SENSORS_BMI160_SCU_I2C
int bmi160accel_register(const char *devpath, int minor,
struct i2c_master_s *dev, int port);
#else /* CONFIG_SENSORS_BMI160_SPI */
#else /* CONFIG_SENSORS_BMI160_SCU_SPI */
int bmi160accel_register(const char *devpath, int minor,
struct spi_dev_s *dev);
#endif
Expand Down
40 changes: 8 additions & 32 deletions include/nuttx/sensors/bmi160.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@

#if defined(CONFIG_SENSORS_BMI160) || defined(CONFIG_SENSORS_BMI160_SCU)

#ifdef CONFIG_SENSORS_BMI160_SCU_I2C
#define CONFIG_SENSORS_BMI160_I2C
#endif

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand Down Expand Up @@ -131,38 +127,18 @@ extern "C"
*
****************************************************************************/

#ifndef CONFIG_SENSORS_BMI160_SCU

# ifdef CONFIG_SENSORS_BMI160_I2C
# ifdef CONFIG_SENSORS_BMI160_UORB
#ifdef CONFIG_SENSORS_BMI160_I2C
# ifdef CONFIG_SENSORS_BMI160_UORB
int bmi160_register_uorb(int devno, FAR struct i2c_master_s *dev);
# else
# else
int bmi160_register(FAR const char *devpath, FAR struct i2c_master_s *dev);
# endif /* CONFIG_SENSORS_BMI160_UORB */
# else /* CONFIG_BMI160_SPI */
# ifdef CONFIG_SENSORS_BMI160_UORB
# endif /* CONFIG_SENSORS_BMI160_UORB */
#else /* CONFIG_BMI160_SPI */
# ifdef CONFIG_SENSORS_BMI160_UORB
int bmi160_register_uorb(int devno, FAR struct spi_dev_s *dev);
# else
# else
int bmi160_register(FAR const char *devpath, FAR struct spi_dev_s *dev);
# endif /* CONFIG_SENSORS_BMI160_UORB */
# endif

#else /* CONFIG_SENSORS_BMI160_SCU */

# ifdef CONFIG_SENSORS_BMI160_I2C
int bmi160_init(FAR struct i2c_master_s *dev, int port);
int bmi160gyro_register(FAR const char *devpath, int minor,
FAR struct i2c_master_s *dev, int port);
int bmi160accel_register(FAR const char *devpath, int minor,
FAR struct i2c_master_s *dev, int port);
# else /* CONFIG_SENSORS_BMI160_SPI */
int bmi160_init(FAR struct spi_dev_s *dev);
int bmi160gyro_register(FAR const char *devpath, int minor,
FAR struct spi_dev_s *dev);
int bmi160accel_register(FAR const char *devpath, int minor,
FAR struct spi_dev_s *dev);
# endif

# endif /* CONFIG_SENSORS_BMI160_UORB */
#endif

#undef EXTERN
Expand Down

0 comments on commit d599949

Please sign in to comment.