1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Use macros for power with integer exponents

This commit is contained in:
Mathias Rasmussen 2021-12-14 11:53:09 +01:00
parent adcc36888b
commit 1b95e3c20f
5 changed files with 6 additions and 5 deletions

View file

@ -393,7 +393,7 @@ void pidInitConfig(const pidProfile_t *pidProfile)
#ifdef USE_THRUST_LINEARIZATION
pidRuntime.thrustLinearization = pidProfile->thrustLinearization / 100.0f;
pidRuntime.throttleCompensateAmount = pidRuntime.thrustLinearization - 0.5f * powf(pidRuntime.thrustLinearization, 2);
pidRuntime.throttleCompensateAmount = pidRuntime.thrustLinearization - 0.5f * sq(pidRuntime.thrustLinearization);
#endif
#if defined(USE_D_MIN)