mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Copter: RC_Channel: add weathervane enable/disable switch
This commit is contained in:
parent
01481b2ec4
commit
3fedd0d8b2
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user