Skip to content

Commit

Permalink
Disable vbat-sagcompensation if voltage source is not ADC (#4025)
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis authored Jun 23, 2024
1 parent cfc1cc6 commit 5c8d344
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/tabs/pid_tuning.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5c8d344

Please sign in to comment.