Skip to content

Commit 433cc04

Browse files
authored
Merge pull request #315 from mikeller/hide_gyro_notch_2_for_legacy
Hide gyro notch filter 2 settings for firmware < 3.0.1.
2 parents 037f262 + da02712 commit 433cc04

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tabs/pid_tuning.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
</div>
469469
</td>
470470
</tr>
471-
<tr class="newFilter">
471+
<tr class="newFilter gyroNotch2">
472472
<td>
473473
<input type="number" class="nonProfile" name="gyroNotch2Frequency" step="1" min="0" max="500"/>
474474
</td>
@@ -481,7 +481,7 @@
481481
</div>
482482
</td>
483483
</tr>
484-
<tr class="newFilter">
484+
<tr class="newFilter gyroNotch2">
485485
<td>
486486
<input type="number" class="nonProfile" name="gyroNotch2Cutoff" step="1" min="0" max="500"/>
487487
</td>

tabs/pid_tuning.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,16 @@ TABS.pid_tuning.initialize = function (callback) {
257257

258258
$('input[name="dtermSetpoint-number"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100);
259259
$('input[name="dtermSetpoint-range"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100);
260-
if (semver.gte(CONFIG.flightControllerVersion, '3.0.1')) {
261-
$('.pid_filter input[name="gyroNotch2Frequency"]').val(FILTER_CONFIG.gyro_soft_notch_hz_2);
262-
$('.pid_filter input[name="gyroNotch2Cutoff"]').val(FILTER_CONFIG.gyro_soft_notch_cutoff_2);
263-
}
264260
} else {
265261
$('.pid_filter .newFilter').hide();
266262
}
263+
264+
if (semver.gte(CONFIG.flightControllerVersion, '3.0.1')) {
265+
$('.pid_filter input[name="gyroNotch2Frequency"]').val(FILTER_CONFIG.gyro_soft_notch_hz_2);
266+
$('.pid_filter input[name="gyroNotch2Cutoff"]').val(FILTER_CONFIG.gyro_soft_notch_cutoff_2);
267+
} else {
268+
$('.pid_filter .gyroNotch2').hide();
269+
}
267270
}
268271

269272
function form_to_pid_and_rc() {

0 commit comments

Comments
 (0)