From 25cc445d7e35d58b4f38ff1bb9c1bf73e3e9cc7d Mon Sep 17 00:00:00 2001 From: Thorsten Laux Date: Thu, 24 May 2018 15:30:55 +0200 Subject: [PATCH] switch micro-optimizations --- src/main/flight/pid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 5d2f6367b..640597b3c 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -641,7 +641,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an const float pidFeedForward = pidCoefficient[axis].Kd * dynCd * transition * (currentPidSetpoint - previousPidSetpoint[axis]) * tpaFactor / dT; - if ((pidData[axis].P > 0) == (pidFeedForward > 0)) { + if (pidData[axis].P * pidFeedForward > 0) { if (ABS(pidFeedForward) > ABS(pidData[axis].P)) { pidData[axis].P = 0; pidData[axis].D += pidFeedForward;