Skip to content

Commit

Permalink
Sub: Disable CH6 Tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxzer authored and tridge committed Feb 21, 2017
1 parent 69d89c5 commit 3010114
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ArduSub/ArduSub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ArduSub/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ArduSub/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ class Parameters {
//
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;
Expand Down
2 changes: 2 additions & 0 deletions ArduSub/Sub.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,9 @@ class Sub : public AP_HAL::HAL::Callbacks {
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);
Expand Down
8 changes: 8 additions & 0 deletions ArduSub/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
3 changes: 2 additions & 1 deletion ArduSub/tuning.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -190,3 +190,4 @@ void Sub::tuning() {
break;
}
}
#endif

0 comments on commit 3010114

Please sign in to comment.