mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 22:35:17 +03:00
Merge pull request #1147 from McGiverGim/fix_pwm_dshot
Fix PWM must be hidden when DSHOT
This commit is contained in:
commit
0598da14c9
1 changed files with 13 additions and 12 deletions
|
@ -356,8 +356,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
esc_protocol_e.append('<option value="' + (i + 1) + '">'+ escprotocols[i] + '</option>');
|
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 () {
|
esc_protocol_e.change(function () {
|
||||||
//hide not used setting for DSHOT protocol
|
//hide not used setting for DSHOT protocol
|
||||||
if ($(this).val() - 1 >= self.DSHOT_PROTOCOL_MIN_VALUE) {
|
if ($(this).val() - 1 >= self.DSHOT_PROTOCOL_MIN_VALUE) {
|
||||||
|
@ -380,9 +392,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
}).change();
|
}).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
|
// Gyro and PID update
|
||||||
var gyroUse32kHz_e = $('input[id="gyroUse32kHz"]');
|
var gyroUse32kHz_e = $('input[id="gyroUse32kHz"]');
|
||||||
|
@ -922,14 +931,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
checkUpdateCurrentControls();
|
checkUpdateCurrentControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("input[id='unsyncedPWMSwitch']").change(function() {
|
|
||||||
if ($(this).is(':checked')) {
|
|
||||||
$('div.unsyncedpwmfreq').show();
|
|
||||||
} else {
|
|
||||||
$('div.unsyncedpwmfreq').hide();
|
|
||||||
}
|
|
||||||
}).change();
|
|
||||||
|
|
||||||
$('a.save').click(function () {
|
$('a.save').click(function () {
|
||||||
// gather data that doesn't have automatic change event bound
|
// gather data that doesn't have automatic change event bound
|
||||||
BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());
|
BOARD_ALIGNMENT_CONFIG.roll = parseInt($('input[name="board_align_roll"]').val());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue