From dafc24b7a1c7d256c4d4bd97a576e28c8afe04bd Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 14 Apr 2023 14:35:51 +1000 Subject: [PATCH] AP_HAL_ChibiOS: tidy external baro probing --- libraries/AP_HAL_ChibiOS/hwdef/F35Lightning/hwdef.dat | 3 --- libraries/AP_HAL_ChibiOS/hwdef/FlywooF745Nano/hwdef.dat | 1 - libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat | 3 +-- libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat | 1 - libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat | 1 - libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat | 1 - libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat | 1 - libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc | 3 +++ libraries/AP_HAL_ChibiOS/hwdef/revo-mini-i2c/hwdef.dat | 3 --- libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat | 3 --- libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat | 1 - 12 files changed, 8 insertions(+), 18 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/F35Lightning/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/F35Lightning/hwdef.dat index 1e8cbf2cff..51e56d07eb 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/F35Lightning/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/F35Lightning/hwdef.dat @@ -137,9 +137,6 @@ COMPASS AK8963:probe_mpu9250 0 ROTATION_YAW_90 define HAL_PROBE_EXTERNAL_I2C_COMPASSES define HAL_I2C_INTERNAL_MASK 0 -# external baro probing -define HAL_PROBE_EXTERNAL_I2C_BAROS - # no onboard SD, filesystem support disabled until flash logging implemented #define HAL_OS_FATFS_IO 1 #define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF745Nano/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF745Nano/hwdef.dat index cb9b0f6401..9bb8bb3609 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF745Nano/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF745Nano/hwdef.dat @@ -26,6 +26,5 @@ DMA_PRIORITY USART1* I2C2* TIM1* TIM3* NODMA I2C* define STM32_I2C_USE_DMA FALSE -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_I2C_INTERNAL_MASK 1 define HAL_FRAME_TYPE_DEFAULT 12 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat index 0c121ee51b..82813917c6 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat @@ -115,9 +115,8 @@ SPIDEV osd SPI3 DEVID3 OSD_CS MODE0 10*MHZ 10*MHZ # One IMU rotated in yaw IMU Invensense SPI:mpu6000 ROTATION_YAW_90 -# Probe for I2C BMP280, but allow external baro +# Probe for I2C BMP280 BARO BMP280 I2C:0:0x76 -define HAL_PROBE_EXTERNAL_I2C_BAROS # no built-in compass, but probe the i2c bus for all possible # external compass types diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat index fdc7ee9511..68627e7777 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat @@ -134,7 +134,6 @@ IMU Invensense SPI:mpu6000 ROTATION_YAW_180 # one BARO BARO BMP280 I2C:0:0x76 -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_BARO_ALLOW_INIT_NO_BARO define HAL_OS_FATFS_IO 1 @@ -165,5 +164,9 @@ define HAL_WITH_MSP_DISPLAYPORT 1 undef HAL_MSP_ENABLED define HAL_MSP_ENABLED 1 +# need to probe external baros even 'though we're minimised: +undef AP_BARO_PROBE_EXTERNAL_I2C_BUSES +define AP_BARO_PROBE_EXTERNAL_I2C_BUSES 1 + # reduce max size of embedded params for apj_tool.py define AP_PARAM_MAX_EMBEDDED_PARAM 1024 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat index 6ed08bb4a3..fdd081e5cf 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat @@ -132,7 +132,6 @@ IMU Invensense SPI:mpu6000 ROTATION_YAW_180 # probe for I2C BMP280, but allow init on board variants without onboard baro too BARO BMP280 I2C:0:0x76 -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_BARO_ALLOW_INIT_NO_BARO define AP_BARO_BACKEND_DEFAULT_ENABLED 0 define AP_BARO_BMP280_ENABLED 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat index d819faefaa..4d0db1ed72 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat @@ -34,7 +34,6 @@ define GPS_MAX_INSTANCES 1 define HAL_COMPASS_MAX_SENSORS 1 # set up for sensors -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_BARO_ALLOW_INIT_NO_BARO define HAL_AIRSPEED_BUS_DEFAULT 0 define AIRSPEED_MAX_SENSORS 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat index af9715dfcd..9ab2b24a6c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat @@ -97,7 +97,6 @@ IMU Invensense SPI:icm20689_2 ROTATION_NONE # one baro BARO BMP280 I2C:0:0x76 -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_BARO_ALLOW_INIT_NO_BARO # no built-in compass, but probe the i2c bus for all possible diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat index 060d854c83..afb04ead2b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat @@ -5,7 +5,6 @@ define CAN_APP_NODE_NAME "org.ardupilot.ap_periph_universal" # and support all external compass and baro types define HAL_PROBE_EXTERNAL_I2C_COMPASSES -define HAL_PROBE_EXTERNAL_I2C_BAROS # enable all features define HAL_PERIPH_ENABLE_GPS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc b/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc index f28223a3b8..f3b9f1f94d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc @@ -78,3 +78,6 @@ define AP_BATTERY_SMBUS_NEODESIGN_ENABLED AP_BATTERY_SMBUS_ENABLED define AP_BATTERY_SMBUS_SUI_ENABLED AP_BATTERY_SMBUS_ENABLED define AP_BATTERY_SMBUS_MAXELL_ENABLED AP_BATTERY_SMBUS_ENABLED define AP_BATTERY_SMBUS_ROTOYE_ENABLED AP_BATTERY_SMBUS_ENABLED + +# don't probe for external Barometers: +define AP_BARO_PROBE_EXTERNAL_I2C_BUSES 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini-i2c/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini-i2c/hwdef.dat index b2b2b161db..35525fc787 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini-i2c/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini-i2c/hwdef.dat @@ -136,9 +136,6 @@ IMU Invensense SPI:mpu6000 ROTATION_YAW_180 # one baro BARO MS56XX I2C:0:0x77 -# also allow for probing of external barometers -define HAL_PROBE_EXTERNAL_I2C_BAROS - # look for internal I2C compass COMPASS HMC5843 I2C:0:0x1E false ROTATION_YAW_270 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat index a84512b565..889689d5c8 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat @@ -117,9 +117,6 @@ IMU Invensense SPI:mpu6000 ROTATION_YAW_180 # one baro BARO MS56XX I2C:0:0x77 -# also allow for probing of external barometers -define HAL_PROBE_EXTERNAL_I2C_BAROS - # look for internal I2C compass COMPASS HMC5843 I2C:0:0x1E false ROTATION_YAW_270 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat index a9b8ab7be9..3a898b13bd 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat @@ -123,7 +123,6 @@ IMU Invensense SPI:mpu6000 ROTATION_YAW_270 # probe for a BMP085, but also look for other baros BARO BMP085 I2C:0:0x77 -define HAL_PROBE_EXTERNAL_I2C_BAROS define HAL_BARO_ALLOW_INIT_NO_BARO # no built-in compass, but probe the i2c bus for all possible