1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 09:15:49 +03:00

Disable vbat-sagcompensation if voltage source is not ADC (#4025)

This commit is contained in:
Mark Haslinghuis 2024-06-23 21:50:54 +02:00 committed by GitHub
parent cfc1cc6893
commit 5c8d344eb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -448,7 +448,8 @@ pid_tuning.initialize = function (callback) {
$('input[name="feedforwardJitterFactor"]').val(FC.ADVANCED_TUNING.feedforward_jitter_factor);
// Vbat Sag Compensation
const vbatSagCompensationCheck = $('input[id="vbatSagCompensation"]');
const enableVbatSagCompensation = FC.BATTERY_CONFIG.voltageMeterSource !== 1;
const vbatSagCompensationCheck = $('input[id="vbatSagCompensation"]').attr('disabled', enableVbatSagCompensation).change();
vbatSagCompensationCheck.prop('checked', FC.ADVANCED_TUNING.vbat_sag_compensation !== 0);
$('input[name="vbatSagValue"]').val(FC.ADVANCED_TUNING.vbat_sag_compensation > 0 ? FC.ADVANCED_TUNING.vbat_sag_compensation : 100);