From 942d1bb384356bdae72fdc210a4d448e828adbdf Mon Sep 17 00:00:00 2001 From: ctzsnooze Date: Wed, 12 Sep 2018 22:02:07 +1000 Subject: [PATCH] add const, remove float cast --- 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 93ad5cdd4..1a5a8707d 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -444,7 +444,7 @@ void pidInitConfig(const pidProfile_t *pidProfile) maxVelocity[FD_ROLL] = maxVelocity[FD_PITCH] = pidProfile->rateAccelLimit * 100 * dT; maxVelocity[FD_YAW] = pidProfile->yawRateAccelLimit * 100 * dT; if (pidProfile->itermWindupPointPercent < 100) { - float ITermWindupPoint = (float)pidProfile->itermWindupPointPercent / 100.0f; + const float ITermWindupPoint = pidProfile->itermWindupPointPercent / 100.0f; ITermWindupPointInv = 1.0f / (1.0f - ITermWindupPoint); } itermAcceleratorGain = pidProfile->itermAcceleratorGain;