Skip to content

Commit 0641b2d

Browse files
committed
fix: remove duplicate autotrim macro definitions from servos.c
Commit 58dc107 re-added SERVO_AUTOTRIM_FILTER_CUTOFF and related constants to servos.c as local #defines, but they were already moved to servos.h by a prior refactor (dcc404e). The duplicate caused a build error: the .c definition used integer 1 while the header has 1.0f, triggering -Werror,-Wmacro-redefined on all targets. Remove the redundant block from servos.c and add the one genuinely new constant (SERVO_AUTOTRIM_ITERM_RATE_LIMIT) to servos.h alongside the existing autotrim constants.
1 parent ac6135d commit 0641b2d

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

src/main/flight/servos.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -607,13 +607,6 @@ void processServoAutotrimMode(void)
607607
}
608608
}
609609

610-
#define SERVO_AUTOTRIM_FILTER_CUTOFF 1 // LPF cutoff frequency
611-
#define SERVO_AUTOTRIM_CENTER_MIN 1300
612-
#define SERVO_AUTOTRIM_CENTER_MAX 1700
613-
#define SERVO_AUTOTRIM_UPDATE_SIZE 5
614-
#define SERVO_AUTOTRIM_ATTITUDE_LIMIT 50 // 5 degrees
615-
#define SERVO_AUTOTRIM_ITERM_RATE_LIMIT 30 // ~90th percentile during stable cruise (blackbox-derived)
616-
617610
void processContinuousServoAutotrim(const float dT)
618611
{
619612
static timeMs_t lastUpdateTimeMs;

src/main/flight/servos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ PG_DECLARE_ARRAY(servoParam_t, MAX_SUPPORTED_SERVOS, servoParams);
166166
#define SERVO_AUTOTRIM_CENTER_MAX 1700
167167
#define SERVO_AUTOTRIM_UPDATE_SIZE 5
168168
#define SERVO_AUTOTRIM_ATTITUDE_LIMIT 50 // 5 degrees
169+
#define SERVO_AUTOTRIM_ITERM_RATE_LIMIT 30 // ~90th percentile during stable cruise (blackbox-derived)
169170

170171
typedef struct servoConfig_s {
171172
// PWM values, in milliseconds, common range is 1000-2000 (1ms to 2ms)

0 commit comments

Comments
 (0)