diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index 1121978b1f..492130e8d1 100755 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -607,7 +607,7 @@ void processRx(timeUs_t currentTimeUs) DISABLE_FLIGHT_MODE(HEADFREE_MODE); } -#if defined(AUTOTUNE_FIXED_WING) || defined(AUTOTUNE_MULTIROTOR) +#if defined(USE_AUTOTUNE_FIXED_WING) || defined(USE_AUTOTUNE_MULTIROTOR) autotuneUpdateState(); #endif diff --git a/src/main/fc/fc_msp_box.c b/src/main/fc/fc_msp_box.c index 7394a2d872..f02ee43cd7 100644 --- a/src/main/fc/fc_msp_box.c +++ b/src/main/fc/fc_msp_box.c @@ -210,7 +210,7 @@ void initActiveBoxIds(void) activeBoxIds[activeBoxIdCount++] = BOXNAVLAUNCH; } activeBoxIds[activeBoxIdCount++] = BOXAUTOTRIM; -#if defined(AUTOTUNE_FIXED_WING) +#if defined(USE_AUTOTUNE_FIXED_WING) activeBoxIds[activeBoxIdCount++] = BOXAUTOTUNE; #endif } diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index c808a1421b..a655f643ef 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -1092,7 +1092,7 @@ groups: - name: PG_PID_AUTOTUNE_CONFIG type: pidAutotuneConfig_t - condition: USE_NAV + condition: USE_NAV && USE_AUTOTUNE_FIXED_WING members: - name: fw_autotune_overshoot_time field: fw_overshoot_time diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 4803e53b7f..02a31b4f26 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -483,7 +483,7 @@ static void pidApplyFixedWingRateController(pidState_t *pidState, flight_dynamic pidState->errorGyroIf = constrainf(pidState->errorGyroIf, -pidProfile()->fixedWingItermThrowLimit, pidProfile()->fixedWingItermThrowLimit); } -#ifdef AUTOTUNE_FIXED_WING +#ifdef USE_AUTOTUNE_FIXED_WING if (FLIGHT_MODE(AUTO_TUNE) && !FLIGHT_MODE(MANUAL_MODE)) { autotuneFixedWingUpdate(axis, pidState->rateTarget, pidState->gyroRate, newPTerm + newFFTerm); } diff --git a/src/main/flight/pid_autotune.c b/src/main/flight/pid_autotune.c index 8417b12efe..508a8d1c3f 100755 --- a/src/main/flight/pid_autotune.c +++ b/src/main/flight/pid_autotune.c @@ -79,7 +79,7 @@ typedef struct { #define AUTOTUNE_SAVE_PERIOD 5000 // Save interval is 5 seconds - when we turn off autotune we'll restore values from previous update at most 5 sec ago -#if defined(AUTOTUNE_FIXED_WING) || defined(AUTOTUNE_MULTIROTOR) +#if defined(USE_AUTOTUNE_FIXED_WING) || defined(USE_AUTOTUNE_MULTIROTOR) static pidAutotuneData_t tuneCurrent[XYZ_AXIS_COUNT]; static pidAutotuneData_t tuneSaved[XYZ_AXIS_COUNT]; @@ -159,7 +159,7 @@ static void blackboxLogAutotuneEvent(adjustmentFunction_e adjustmentFunction, in #endif } -#if defined(AUTOTUNE_FIXED_WING) +#if defined(USE_AUTOTUNE_FIXED_WING) void autotuneFixedWingUpdate(const flight_dynamics_index_t axis, float desiredRateDps, float reachedRateDps, float pidOutput) { diff --git a/src/main/target/common.h b/src/main/target/common.h index 298fa00dd6..7d7fd39938 100755 --- a/src/main/target/common.h +++ b/src/main/target/common.h @@ -65,7 +65,7 @@ #if (FLASH_SIZE > 128) #define NAV_FIXED_WING_LANDING -#define AUTOTUNE_FIXED_WING +#define USE_AUTOTUNE_FIXED_WING #define USE_ASYNC_GYRO_PROCESSING #define USE_DEBUG_TRACE #define USE_BOOTLOG