diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index 3e998ea75c..636821371e 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -63,7 +63,6 @@ #include "fc/runtime_config.h" #include "flight/alt_hold.h" -#include "flight/pos_hold.h" #include "flight/autopilot.h" #include "flight/failsafe.h" #include "flight/gps_rescue.h" diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index 1dff695952..859212e692 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -104,7 +104,6 @@ bool cliMode = false; #include "fc/rc_controls.h" #include "fc/runtime_config.h" -#include "flight/autopilot.h" #include "flight/failsafe.h" #include "flight/imu.h" #include "flight/mixer.h" diff --git a/src/main/fc/tasks.c b/src/main/fc/tasks.c index e03678c602..bff7524067 100644 --- a/src/main/fc/tasks.c +++ b/src/main/fc/tasks.c @@ -53,13 +53,12 @@ #include "fc/rc_controls.h" #include "fc/runtime_config.h" +#include "flight/alt_hold.h" #include "flight/gps_rescue.h" #include "flight/imu.h" #include "flight/mixer.h" #include "flight/pid.h" #include "flight/position.h" -#include "flight/autopilot.h" -#include "flight/alt_hold.h" #include "flight/pos_hold.h" #include "io/asyncfatfs/asyncfatfs.h" diff --git a/src/main/flight/autopilot.c b/src/main/flight/autopilot.c index f73baf918c..ddfd1e84cc 100644 --- a/src/main/flight/autopilot.c +++ b/src/main/flight/autopilot.c @@ -45,11 +45,11 @@ #define POSITION_J_SCALE 0.0008f static pidCoefficient_t altitudePidCoeffs; +static pidCoefficient_t positionPidCoeffs; + static float altitudeI = 0.0f; static float throttleOut = 0.0f; -static pidCoefficient_t positionPidCoeffs; - typedef struct { uint32_t distanceCm; uint32_t previousDistanceCm; @@ -78,7 +78,6 @@ static posHoldState posHold = { static gpsLocation_t currentTargetLocation = {0, 0, 0}; float posHoldAngle[ANGLE_INDEX_COUNT]; - static pt1Filter_t velocityPitchLpf; static pt1Filter_t accelerationPitchLpf; static pt1Filter_t velocityRollLpf; diff --git a/src/main/flight/autopilot.h b/src/main/flight/autopilot.h index 11313e429c..049bb5eac0 100644 --- a/src/main/flight/autopilot.h +++ b/src/main/flight/autopilot.h @@ -31,5 +31,4 @@ void altitudeControl(float targetAltitudeCm, float taskIntervalS, float vertical bool positionControl(float deadband); bool isBelowLandingAltitude(void); -const pidCoefficient_t *getAltitudePidCoeffs(void); float getAutopilotThrottle(void); diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 5c36e1b172..1e3964e7bf 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -46,7 +46,6 @@ #include "fc/rc_controls.h" #include "fc/runtime_config.h" -#include "flight/alt_hold.h" #include "flight/autopilot.h" #include "flight/gps_rescue.h" #include "flight/imu.h" diff --git a/src/main/flight/pos_hold.c b/src/main/flight/pos_hold.c index 716ef45373..8b2d00fd19 100644 --- a/src/main/flight/pos_hold.c +++ b/src/main/flight/pos_hold.c @@ -21,8 +21,8 @@ #include "math.h" #include "build/debug.h" - #include "common/maths.h" + #include "config/config.h" #include "fc/runtime_config.h" #include "fc/rc.h"