diff --git a/libraries/AP_WindVane/AP_WindVane.cpp b/libraries/AP_WindVane/AP_WindVane.cpp index abeb3e7477..c31b58b06f 100644 --- a/libraries/AP_WindVane/AP_WindVane.cpp +++ b/libraries/AP_WindVane/AP_WindVane.cpp @@ -35,13 +35,7 @@ const AP_Param::GroupInfo AP_WindVane::var_info[] = { // @RebootRequired: True AP_GROUPINFO_FLAGS("TYPE", 1, AP_WindVane, _direction_type, 0, AP_PARAM_FLAG_ENABLE), - // @Param: RC_IN_NO - // @DisplayName: Wind vane sensor RC Input Channel - // @Description: RC Input Channel to use as wind angle value - // @Range: 0 16 - // @Increment: 1 - // @User: Standard - AP_GROUPINFO("RC_IN_NO", 2, AP_WindVane, _rc_in_no, 0), + // 2 was RC_IN_NO // @Param: DIR_PIN // @DisplayName: Wind vane analog voltage pin for direction diff --git a/libraries/AP_WindVane/AP_WindVane.h b/libraries/AP_WindVane/AP_WindVane.h index ee32ba4aa7..635f7e5165 100644 --- a/libraries/AP_WindVane/AP_WindVane.h +++ b/libraries/AP_WindVane/AP_WindVane.h @@ -98,7 +98,6 @@ private: // parameters AP_Int8 _direction_type; // type of windvane being used - AP_Int8 _rc_in_no; // RC input channel to use AP_Int8 _dir_analog_pin; // analog pin connected to wind vane direction sensor AP_Float _dir_analog_volt_min; // minimum voltage read by windvane AP_Float _dir_analog_volt_max; // maximum voltage read by windvane diff --git a/libraries/AP_WindVane/AP_WindVane_Home.cpp b/libraries/AP_WindVane/AP_WindVane_Home.cpp index 657d8b5ea6..d621785bba 100644 --- a/libraries/AP_WindVane/AP_WindVane_Home.cpp +++ b/libraries/AP_WindVane/AP_WindVane_Home.cpp @@ -25,8 +25,8 @@ void AP_WindVane_Home::update_direction() { float direction_apparent_ef = _frontend._home_heading; - if (_frontend._direction_type == _frontend.WINDVANE_PWM_PIN && _frontend._rc_in_no != 0) { - RC_Channel *chan = rc().channel(_frontend._rc_in_no-1); + if (_frontend._direction_type == _frontend.WINDVANE_PWM_PIN) { + RC_Channel *chan = rc().find_channel_for_option(RC_Channel::AUX_FUNC::WIND_VANE_DIR_OFSSET); if (chan != nullptr) { direction_apparent_ef += chan->norm_input() * radians(45); }