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

jerpelea 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 51b3dbb78d sensors: Remove duplicated defnitions from bmi160.h
51b3dbb78d is described below

commit 51b3dbb78d089da0e2ad7d2a6884473b55707e77
Author: SPRESENSE <41312067+sprese...@users.noreply.github.com>
AuthorDate: Tue Feb 27 16:13:52 2024 +0900

    sensors: Remove duplicated defnitions from bmi160.h
    
    Remove duplicated defnitions from bmi160.h.
---
 .../arm/cxd56xx/spresense/include/cxd56_bmi160.h   | 12 +++----
 include/nuttx/sensors/bmi160.h                     | 40 +++++-----------------
 2 files changed, 14 insertions(+), 38 deletions(-)

diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h 
b/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h
index 90b5654184..1367d8dc50 100644
--- a/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h
+++ b/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h
@@ -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
 
@@ -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
@@ -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
diff --git a/include/nuttx/sensors/bmi160.h b/include/nuttx/sensors/bmi160.h
index 2296278919..d43c3de448 100644
--- a/include/nuttx/sensors/bmi160.h
+++ b/include/nuttx/sensors/bmi160.h
@@ -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
  ****************************************************************************/
@@ -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

Reply via email to