From 028017e38ef609e3def1548599f3d1fd840797d4 Mon Sep 17 00:00:00 2001 From: Luca Pescante Date: Sat, 7 Oct 2023 18:43:21 +0800 Subject: [PATCH] ArduCopter/RC_Channel: add option 219 (Transmitter Tuning) --- ArduCopter/RC_Channel.cpp | 4 ++++ libraries/RC_Channel/RC_Channel.cpp | 1 + libraries/RC_Channel/RC_Channel.h | 1 + 3 files changed, 6 insertions(+) diff --git a/ArduCopter/RC_Channel.cpp b/ArduCopter/RC_Channel.cpp index 3cb3b99ea2..c62f8b6d2b 100644 --- a/ArduCopter/RC_Channel.cpp +++ b/ArduCopter/RC_Channel.cpp @@ -128,6 +128,7 @@ void RC_Channel_Copter::init_aux_function(const AUX_FUNC ch_option, const AuxSwi case AUX_FUNC::FORCEFLYING: case AUX_FUNC::CUSTOM_CONTROLLER: case AUX_FUNC::WEATHER_VANE_ENABLE: + case AUX_FUNC::TRANSMITTER_TUNING: run_aux_function(ch_option, ch_flag, AuxFuncTriggerSource::INIT); break; default: @@ -648,6 +649,9 @@ bool RC_Channel_Copter::do_aux_function(const AUX_FUNC ch_option, const AuxSwitc break; } #endif + case AUX_FUNC::TRANSMITTER_TUNING: + // do nothing, used in tuning.cpp for transmitter based tuning + break; default: return RC_Channel::do_aux_function(ch_option, ch_flag); diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 8d27aeb426..e0bdfed8e4 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -247,6 +247,7 @@ const AP_Param::GroupInfo RC_Channel::var_info[] = { // @Values{Plane}: 210:Airbrakes // @Values{Rover}: 211:Walking Height // @Values{Copter, Rover, Plane}: 212:Mount1 Roll, 213:Mount1 Pitch, 214:Mount1 Yaw, 215:Mount2 Roll, 216:Mount2 Pitch, 217:Mount2 Yaw + // @Values{Copter}: 219:Transmitter Tuning // @Values{Copter, Rover, Plane}: 300:Scripting1, 301:Scripting2, 302:Scripting3, 303:Scripting4, 304:Scripting5, 305:Scripting6, 306:Scripting7, 307:Scripting8 // @User: Standard AP_GROUPINFO_FRAME("OPTION", 6, RC_Channel, option, 0, AP_PARAM_FRAME_COPTER|AP_PARAM_FRAME_ROVER|AP_PARAM_FRAME_PLANE|AP_PARAM_FRAME_BLIMP), diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 9995948070..97dddce75b 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -271,6 +271,7 @@ public: MOUNT2_PITCH = 216, // mount3 pitch input MOUNT2_YAW = 217, // mount4 yaw input LOWEHEISER_THROTTLE= 218, // allows for throttle on slider + TRANSMITTER_TUNING = 219, // use a transmitter knob or slider for in-flight tuning // inputs 248-249 are reserved for the Skybrush fork at // https://github.com/skybrush-io/ardupilot