1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Prevent 0 in 'vbat_display_lpf_period' to avoid division by zero.

This commit is contained in:
mikeller 2020-03-21 12:57:10 +13:00
parent d63ba914c6
commit b020917c4b
4 changed files with 14 additions and 12 deletions

View file

@ -232,7 +232,9 @@ void tasksInit(void)
#if defined(USE_BATTERY_VOLTAGE_SAG_COMPENSATION)
// If vbat motor output compensation is used, use fast vbat samplingTime
rescheduleTask(TASK_BATTERY_VOLTAGE, TASK_PERIOD_HZ(getBatteryVoltageTaskFrequencyHz()));
if (isSagCompensationConfigured()) {
rescheduleTask(TASK_BATTERY_VOLTAGE, TASK_PERIOD_HZ(FAST_VOLTAGE_TASK_FREQ_HZ));
}
#endif
const bool useBatteryCurrent = batteryConfig()->currentMeterSource != CURRENT_METER_NONE;