From 5ed5631c3cded78b85bd9a1f976ea88748e9799e Mon Sep 17 00:00:00 2001 From: Josh Welsh Date: Tue, 4 Aug 2020 14:53:27 -0700 Subject: [PATCH] AP_Airspeed: Add additional DLVR support 20inH2O 30inH2O 60inH2O --- libraries/AP_Airspeed/AP_Airspeed.cpp | 19 +++++++++++++++++-- libraries/AP_Airspeed/AP_Airspeed.h | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Airspeed/AP_Airspeed.cpp b/libraries/AP_Airspeed/AP_Airspeed.cpp index c114487ae8..6f58ef189a 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed.cpp @@ -76,7 +76,7 @@ const AP_Param::GroupInfo AP_Airspeed::var_info[] = { // @Param: _TYPE // @DisplayName: Airspeed type // @Description: Type of airspeed sensor - // @Values: 0:None,1:I2C-MS4525D0,2:Analog,3:I2C-MS5525,4:I2C-MS5525 (0x76),5:I2C-MS5525 (0x77),6:I2C-SDP3X,7:I2C-DLVR-5in,8:UAVCAN,9:I2C-DLVR-10in + // @Values: 0:None,1:I2C-MS4525D0,2:Analog,3:I2C-MS5525,4:I2C-MS5525 (0x76),5:I2C-MS5525 (0x77),6:I2C-SDP3X,7:I2C-DLVR-5in,8:UAVCAN,9:I2C-DLVR-10in,10:I2C-DLVR-20in,11:I2C-DLVR-30in,12:I2C-DLVR-60in // @User: Standard AP_GROUPINFO_FLAGS("_TYPE", 0, AP_Airspeed, param[0].type, ARSPD_DEFAULT_TYPE, AP_PARAM_FLAG_ENABLE), @@ -161,7 +161,7 @@ const AP_Param::GroupInfo AP_Airspeed::var_info[] = { // @Param: 2_TYPE // @DisplayName: Second Airspeed type // @Description: Type of 2nd airspeed sensor - // @Values: 0:None,1:I2C-MS4525D0,2:Analog,3:I2C-MS5525,4:I2C-MS5525 (0x76),5:I2C-MS5525 (0x77),6:I2C-SDP3X,7:I2C-DLVR-5in,8:UAVCAN,9:I2C-DLVR-10in + // @Values: 0:None,1:I2C-MS4525D0,2:Analog,3:I2C-MS5525,4:I2C-MS5525 (0x76),5:I2C-MS5525 (0x77),6:I2C-SDP3X,7:I2C-DLVR-5in,8:UAVCAN,9:I2C-DLVR-10in,10:I2C-DLVR-20in,11:I2C-DLVR-30in,12:I2C-DLVR-60in // @User: Standard AP_GROUPINFO_FLAGS("2_TYPE", 11, AP_Airspeed, param[1].type, 0, AP_PARAM_FLAG_ENABLE), @@ -297,6 +297,21 @@ void AP_Airspeed::init() case TYPE_I2C_DLVR_10IN: #if !HAL_MINIMIZE_FEATURES sensor[i] = new AP_Airspeed_DLVR(*this, i, 10); +#endif // !HAL_MINIMIZE_FEATURES + break; + case TYPE_I2C_DLVR_20IN: +#if !HAL_MINIMIZE_FEATURES + sensor[i] = new AP_Airspeed_DLVR(*this, i, 20); +#endif // !HAL_MINIMIZE_FEATURES + break; + case TYPE_I2C_DLVR_30IN: +#if !HAL_MINIMIZE_FEATURES + sensor[i] = new AP_Airspeed_DLVR(*this, i, 30); +#endif // !HAL_MINIMIZE_FEATURES + break; + case TYPE_I2C_DLVR_60IN: +#if !HAL_MINIMIZE_FEATURES + sensor[i] = new AP_Airspeed_DLVR(*this, i, 60); #endif // !HAL_MINIMIZE_FEATURES break; case TYPE_UAVCAN: diff --git a/libraries/AP_Airspeed/AP_Airspeed.h b/libraries/AP_Airspeed/AP_Airspeed.h index b3638273be..f9904eeaa4 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.h +++ b/libraries/AP_Airspeed/AP_Airspeed.h @@ -153,6 +153,9 @@ public: TYPE_I2C_DLVR_5IN=7, TYPE_UAVCAN=8, TYPE_I2C_DLVR_10IN=9, + TYPE_I2C_DLVR_20IN=10, + TYPE_I2C_DLVR_30IN=11, + TYPE_I2C_DLVR_60IN=12, }; // get current primary sensor