diff --git a/ArduCopter/RC_Channel.cpp b/ArduCopter/RC_Channel.cpp index b9066f0828..42264baa07 100644 --- a/ArduCopter/RC_Channel.cpp +++ b/ArduCopter/RC_Channel.cpp @@ -121,6 +121,7 @@ void RC_Channel_Copter::init_aux_function(const aux_func_t ch_option, const AuxS case AUX_FUNC::AIRMODE: case AUX_FUNC::FORCEFLYING: case AUX_FUNC::CUSTOM_CONTROLLER: + case AUX_FUNC::WEATHER_VANE_ENABLE: run_aux_function(ch_option, ch_flag, AuxFuncTriggerSource::INIT); break; default: @@ -618,6 +619,22 @@ bool RC_Channel_Copter::do_aux_function(const aux_func_t ch_option, const AuxSwi break; #endif +#if WEATHERVANE_ENABLED == ENABLED + case AUX_FUNC::WEATHER_VANE_ENABLE: { + switch (ch_flag) { + case AuxSwitchPos::HIGH: + copter.g2.weathervane.allow_weathervaning(true); + break; + case AuxSwitchPos::MIDDLE: + break; + case AuxSwitchPos::LOW: + copter.g2.weathervane.allow_weathervaning(false); + break; + } + break; + } +#endif + default: return RC_Channel::do_aux_function(ch_option, ch_flag); }