@@ -82,7 +82,7 @@ void Reset_servoMixers(servoMixer_t *instance)
8282#ifdef USE_PROGRAMMING_FRAMEWORK
8383 ,.conditionId = -1
8484#endif
85- );
85+ );
8686 }
8787}
8888
@@ -96,7 +96,7 @@ void pgResetFn_servoParams(servoParam_t *instance)
9696 .max = DEFAULT_SERVO_MAX ,
9797 .middle = DEFAULT_SERVO_MIDDLE ,
9898 .rate = 100
99- );
99+ );
100100 }
101101}
102102
@@ -194,7 +194,7 @@ void servosInit(void)
194194}
195195
196196int getServoCount (void )
197- {
197+ {
198198 if (mixerUsesServos ) {
199199 return 1 + maxServoIndex - minServoIndex ;
200200 }
@@ -246,7 +246,7 @@ static void filterServos(void)
246246void writeServos (void )
247247{
248248 filterServos ();
249-
249+
250250#if !defined(SITL_BUILD )
251251 int servoIndex = 0 ;
252252 bool zeroServoValue = false;
@@ -449,7 +449,7 @@ void processServoAutotrimMode(void)
449449 static int32_t servoMiddleAccum [MAX_SUPPORTED_SERVOS ];
450450 static int32_t servoMiddleAccumCount [MAX_SUPPORTED_SERVOS ];
451451
452- if (IS_RC_MODE_ACTIVE (BOXAUTOTRIM )) {
452+ if (isFwAutoModeActive (BOXAUTOTRIM )) {
453453 switch (trimState ) {
454454 case AUTOTRIM_IDLE :
455455 if (ARMING_FLAG (ARMED )) {
@@ -544,7 +544,7 @@ void processServoAutotrimMode(void)
544544void processContinuousServoAutotrim (const float dT )
545545{
546546 static timeMs_t lastUpdateTimeMs ;
547- static servoAutotrimState_e trimState = AUTOTRIM_IDLE ;
547+ static servoAutotrimState_e trimState = AUTOTRIM_IDLE ;
548548 static uint32_t servoMiddleUpdateCount ;
549549
550550 const float rotRateMagnitudeFiltered = pt1FilterApply4 (& rotRateFilter , fast_fsqrtf (vectorNormSquared (& imuMeasuredRotationBF )), SERVO_AUTOTRIM_FILTER_CUTOFF , dT );
@@ -556,16 +556,16 @@ void processContinuousServoAutotrim(const float dT)
556556 const bool planeIsFlyingStraight = rotRateMagnitudeFiltered <= DEGREES_TO_RADIANS (servoConfig ()-> servo_autotrim_rotation_limit );
557557 const bool noRotationCommanded = targetRateMagnitudeFiltered <= servoConfig ()-> servo_autotrim_rotation_limit ;
558558 const bool sticksAreCentered = !areSticksDeflected ();
559- const bool planeIsFlyingLevel = ABS (attitude .values .pitch + DEGREES_TO_DECIDEGREES (getFixedWingLevelTrim ())) <= SERVO_AUTOTRIM_ATTITUDE_LIMIT
559+ const bool planeIsFlyingLevel = ABS (attitude .values .pitch + DEGREES_TO_DECIDEGREES (getFixedWingLevelTrim ())) <= SERVO_AUTOTRIM_ATTITUDE_LIMIT
560560 && ABS (attitude .values .roll ) <= SERVO_AUTOTRIM_ATTITUDE_LIMIT ;
561561 if (
562- planeIsFlyingStraight &&
563- noRotationCommanded &&
562+ planeIsFlyingStraight &&
563+ noRotationCommanded &&
564564 planeIsFlyingLevel &&
565565 sticksAreCentered &&
566- !FLIGHT_MODE (MANUAL_MODE ) &&
566+ !FLIGHT_MODE (MANUAL_MODE ) &&
567567 isGPSHeadingValid () // TODO: proper flying detection
568- ) {
568+ ) {
569569 // Plane is flying straight and level: trim servos
570570 for (int axis = FD_ROLL ; axis <= FD_PITCH ; axis ++ ) {
571571 // For each stabilized axis, add 5 units of I-term to all associated servo midpoints
@@ -610,7 +610,7 @@ void processContinuousServoAutotrim(const float dT)
610610 DEBUG_SET (DEBUG_AUTOTRIM , 1 , servoMiddleUpdateCount );
611611 DEBUG_SET (DEBUG_AUTOTRIM , 3 , MAX (RADIANS_TO_DEGREES (rotRateMagnitudeFiltered ), targetRateMagnitudeFiltered ));
612612 DEBUG_SET (DEBUG_AUTOTRIM , 5 , axisPID_I [FD_ROLL ]);
613- DEBUG_SET (DEBUG_AUTOTRIM , 7 , axisPID_I [FD_PITCH ]);
613+ DEBUG_SET (DEBUG_AUTOTRIM , 7 , axisPID_I [FD_PITCH ]);
614614}
615615
616616void processServoAutotrim (const float dT ) {
0 commit comments