From 3010114adbfb3251551a0bf479985c341a5cd996 Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Fri, 25 Nov 2016 22:55:35 -0500 Subject: [PATCH] Sub: Disable CH6 Tuning --- ArduSub/ArduSub.cpp | 2 ++ ArduSub/Parameters.cpp | 2 ++ ArduSub/Parameters.h | 2 ++ ArduSub/Sub.h | 2 ++ ArduSub/config.h | 8 ++++++++ ArduSub/tuning.cpp | 3 ++- 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ArduSub/ArduSub.cpp b/ArduSub/ArduSub.cpp index 7e0a5bdd13..0c82ee5118 100644 --- a/ArduSub/ArduSub.cpp +++ b/ArduSub/ArduSub.cpp @@ -465,8 +465,10 @@ void Sub::three_hz_loop() update_events(); +#if CH6_TUNE_ENABLED == ENABLED // update ch6 in flight tuning tuning(); +#endif } // one_hz_loop - runs at 1Hz diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index e856c4a04d..7e4096b503 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -366,6 +366,7 @@ const AP_Param::Info Sub::var_info[] = { // @Values: 0:Normal Start-up, 1:Start-up in ESC Calibration mode if throttle high, 2:Start-up in ESC Calibration mode regardless of throttle, 9:Disabled GSCALAR(esc_calibrate, "ESC_CALIBRATION", 0), +#if CH6_TUNE_ENABLED == ENABLED // @Param: TUNE // @DisplayName: Channel 6 Tuning // @Description: Controls which parameters (normally PID gains) are being tuned with transmitter's channel 6 knob @@ -386,6 +387,7 @@ const AP_Param::Info Sub::var_info[] = { // @User: Standard // @Range: 0 32767 GSCALAR(radio_tuning_high, "TUNE_HIGH", 1000), +#endif #if AUXSW_ENABLED == ENABLED // @Param: CH7_OPT diff --git a/ArduSub/Parameters.h b/ArduSub/Parameters.h index 4e2c8ff409..8bc2a1eedd 100644 --- a/ArduSub/Parameters.h +++ b/ArduSub/Parameters.h @@ -343,9 +343,11 @@ public: // AP_Int32 log_bitmask; AP_Int8 esc_calibrate; +#if CH6_TUNE_ENABLED == ENABLED AP_Int8 radio_tuning; AP_Int16 radio_tuning_high; AP_Int16 radio_tuning_low; +#endif AP_Int8 ch7_option; AP_Int8 ch8_option; AP_Int8 ch9_option; diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index aad3f30dce..e90cb894ab 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -859,7 +859,9 @@ private: void check_usb_mux(void); bool should_log(uint32_t mask); void print_hit_enter(); +#if CH6_TUNE_ENABLED == ENABLED void tuning(); +#endif void gcs_send_text_fmt(MAV_SEVERITY severity, const char *fmt, ...); bool start_command(const AP_Mission::Mission_Command& cmd); bool verify_command(const AP_Mission::Mission_Command& cmd); diff --git a/ArduSub/config.h b/ArduSub/config.h index ff76676947..da4fbc3a83 100644 --- a/ArduSub/config.h +++ b/ArduSub/config.h @@ -86,6 +86,14 @@ # define RC_FAST_SPEED 490 #endif +////////////////////////////////////////////////////////////////////////////// +// Channel 6 Tuning +// + +#ifndef CH6_TUNE_ENABLED +# define CH6_TUNE_ENABLED DISABLED +#endif + ////////////////////////////////////////////////////////////////////////////// // Aux Switches // diff --git a/ArduSub/tuning.cpp b/ArduSub/tuning.cpp index 5ca974ad1d..cd42ef3e0e 100644 --- a/ArduSub/tuning.cpp +++ b/ArduSub/tuning.cpp @@ -1,6 +1,6 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- - #include "Sub.h" +#if CH6_TUNE_ENABLED == ENABLED /* * tuning.pde - function to update various parameters in flight using the ch6 tuning knob @@ -190,3 +190,4 @@ void Sub::tuning() { break; } } +#endif