mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
prevent divide by zero
This commit is contained in:
parent
ad253c146b
commit
998845be3e
1 changed files with 4 additions and 2 deletions
|
@ -607,8 +607,10 @@ void pidInitConfig(const pidProfile_t *pidProfile)
|
||||||
|
|
||||||
#ifdef USE_THRUST_LINEARIZATION
|
#ifdef USE_THRUST_LINEARIZATION
|
||||||
thrustLinearization = pidProfile->thrustLinearization / 100.0f;
|
thrustLinearization = pidProfile->thrustLinearization / 100.0f;
|
||||||
thrustLinearizationReciprocal = 1.0f / thrustLinearization;
|
if (thrustLinearization != 0.0f) {
|
||||||
thrustLinearizationB = (1.0f - thrustLinearization) / (2.0f * thrustLinearization);
|
thrustLinearizationReciprocal = 1.0f / thrustLinearization;
|
||||||
|
thrustLinearizationB = (1.0f - thrustLinearization) / (2.0f * thrustLinearization);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue