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

Merge pull request #1147 from McGiverGim/fix_pwm_dshot

Fix PWM must be hidden when DSHOT
This commit is contained in:
Michael Keller 2018-08-06 07:47:45 +12:00 committed by GitHub
commit 0598da14c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -356,8 +356,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
esc_protocol_e.append('<option value="' + (i + 1) + '">'+ escprotocols[i] + '</option>');
}
esc_protocol_e.val(PID_ADVANCED_CONFIG.fast_pwm_protocol + 1);
$("input[id='unsyncedPWMSwitch']").change(function() {
if ($(this).is(':checked')) {
$('div.unsyncedpwmfreq').show();
} else {
$('div.unsyncedpwmfreq').hide();
}
});
$('input[id="unsyncedPWMSwitch"]').prop('checked', PID_ADVANCED_CONFIG.use_unsyncedPwm !== 0).change();
$('input[name="unsyncedpwmfreq"]').val(PID_ADVANCED_CONFIG.motor_pwm_rate);
$('input[name="digitalIdlePercent"]').val(PID_ADVANCED_CONFIG.digitalIdlePercent);
esc_protocol_e.val(PID_ADVANCED_CONFIG.fast_pwm_protocol + 1);
esc_protocol_e.change(function () {
//hide not used setting for DSHOT protocol
if ($(this).val() - 1 >= self.DSHOT_PROTOCOL_MIN_VALUE) {
@ -380,9 +392,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
}).change();
$('input[id="unsyncedPWMSwitch"]').prop('checked', PID_ADVANCED_CONFIG.use_unsyncedPwm !== 0);
$('input[name="unsyncedpwmfreq"]').val(PID_ADVANCED_CONFIG.motor_pwm_rate);
$('input[name="digitalIdlePercent"]').val(PID_ADVANCED_CONFIG.digitalIdlePercent);
// Gyro and PID update
var gyroUse32kHz_e = $('input[id="gyroUse32kHz"]');
@ -922,14 +931,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
checkUpdateCurrentControls();
}
$("input[id='unsyncedPWMSwitch']").change(function() {
if ($(this).is(':checked')) {
$('div.unsyncedpwmfreq').show();
} else {
$('div.unsyncedpwmfreq').hide();
}
}).change();
$('a.save').click(function () {
// gather data that doesn't have automatic change event bound
BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());