mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Merge pull request #9645 from etracer65/mixer_vbat_comp_div0
Fix division by 0 risk in mixer vbat sag compensation
This commit is contained in:
commit
9c248b1dcf
1 changed files with 1 additions and 1 deletions
|
@ -366,7 +366,7 @@ void mixerInitProfile(void)
|
||||||
//TODO: Make this voltage user configurable
|
//TODO: Make this voltage user configurable
|
||||||
vbatFull = CELL_VOLTAGE_FULL_CV;
|
vbatFull = CELL_VOLTAGE_FULL_CV;
|
||||||
vbatRangeToCompensate = vbatFull - batteryConfig()->vbatwarningcellvoltage;
|
vbatRangeToCompensate = vbatFull - batteryConfig()->vbatwarningcellvoltage;
|
||||||
if (vbatRangeToCompensate >= 0) {
|
if (vbatRangeToCompensate > 0) {
|
||||||
vbatSagCompensationFactor = ((float)currentPidProfile->vbat_sag_compensation) / 100.0f;
|
vbatSagCompensationFactor = ((float)currentPidProfile->vbat_sag_compensation) / 100.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue