Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,9 @@
"receiverRcSetpointTypeSelect": {
"message": "Setpoint Cutoff Type"
},
"receiverThrottleTypeSelect": {
"message": "Throttle Cutoff Type"
},
"receiverRcSmoothingInterpolation": {
"message": "Interpolation"
},
Expand All @@ -2095,9 +2098,18 @@
"receiverRcSmoothingFeedforwardManual": {
"message": "Selects whether the feedforward filter cutoff frequency is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight."
},
"receiverRcSmoothingThrottleManual": {
"message": "Selects whether RC smoothing is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight."
},
"rcSmoothingThrottleCutoffHelp": {
"message": "The cutoff frequency in Hz used by the throttle smoothing filter. Using lower values will result in smoother inputs and are more appropriate for slower receiver protocols. Most users should leave this at 0 corresponding to \"Auto\"."
},
"receiverRcSmoothingSetpointHz": {
"message": "Setpoint Cutoff Frequency"
},
"receiverRcSmoothingThrottleCutoffHz": {
"message": "Throttle Cutoff Frequency"
},
"receiverRcSmoothingFeedforwardCutoff": {
"message": "Feedforward Cutoff Frequency"
},
Expand Down
1 change: 1 addition & 0 deletions src/js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ const FC = {
fpvCamAngleDegrees: 0,
rcSmoothingType: 0,
rcSmoothingSetpointCutoff: 0,
rcSmoothingThrottleCutoff: 0,
rcSmoothingFeedforwardCutoff: 0,
rcSmoothingInputType: 0,
rcSmoothingDerivativeType: 0,
Expand Down
17 changes: 12 additions & 5 deletions src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,11 @@ MspHelper.prototype.process_data = function (dataHandler) {
data.readU8(); // was FC.RX_CONFIG.rcInterpolationChannels
data.readU8(); // was FC.RX_CONFIG.rcSmoothingType
FC.RX_CONFIG.rcSmoothingSetpointCutoff = data.readU8();
FC.RX_CONFIG.rcSmoothingFeedforwardCutoff = data.readU8(); // deprecated in 1.47
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
FC.RX_CONFIG.rcSmoothingThrottleCutoff = data.readU8();
} else {
FC.RX_CONFIG.rcSmoothingFeedforwardCutoff = data.readU8(); // deprecated in 1.47
}
data.readU8(); // was FC.RX_CONFIG.rcSmoothingInputType
data.readU8(); // was FC.RX_CONFIG.rcSmoothingDerivativeType
FC.RX_CONFIG.usbCdcHidType = data.readU8();
Expand Down Expand Up @@ -1995,10 +1999,13 @@ MspHelper.prototype.crunch = function (code, modifierCode = undefined) {
.push8(FC.RX_CONFIG.fpvCamAngleDegrees)
.push8(FC.RX_CONFIG.rcInterpolationChannels)
.push8(FC.RX_CONFIG.rcSmoothingType)
.push8(FC.RX_CONFIG.rcSmoothingSetpointCutoff)
.push8(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff) // deprecated in 1.47
.push8(FC.RX_CONFIG.rcSmoothingInputType)
.push8(FC.RX_CONFIG.rcSmoothingDerivativeType);
.push8(FC.RX_CONFIG.rcSmoothingSetpointCutoff);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
buffer.push8(FC.RX_CONFIG.rcSmoothingThrottleCutoff);
} else {
buffer.push8(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff);
}
buffer.push8(FC.RX_CONFIG.rcSmoothingInputType).push8(FC.RX_CONFIG.rcSmoothingDerivativeType);

// Introduced in 1.42
buffer.push8(FC.RX_CONFIG.usbCdcHidType).push8(FC.RX_CONFIG.rcSmoothingAutoFactor);
Expand Down
28 changes: 27 additions & 1 deletion src/js/tabs/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,11 @@ receiver.initialize = function (callback) {

FC.RX_CONFIG.rcSmoothingSetpointCutoff = parseInt($('input[name="rcSmoothingSetpointHz-number"]').val());

if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
FC.RX_CONFIG.rcSmoothingThrottleCutoff = parseInt(
$('input[name="rcSmoothingThrottleCutoffHz-number"]').val(),
);
} else {
FC.RX_CONFIG.rcSmoothingFeedforwardCutoff = parseInt(
$('input[name="rcSmoothingFeedforwardCutoff-number"]').val(),
);
Expand Down Expand Up @@ -649,7 +653,29 @@ receiver.initialize = function (callback) {

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
$(".tab-receiver .rcSmoothing-feedforward-manual").hide();

const rcSmoothingThrottleNumberElement = $('input[name="rcSmoothingThrottleCutoffHz-number"]');
rcSmoothingThrottleNumberElement.val(FC.RX_CONFIG.rcSmoothingThrottleCutoff);

$('select[name="rcSmoothing-throttle-manual-select"]').val("1");
if (FC.RX_CONFIG.rcSmoothingThrottleCutoff === 0) {
$('select[name="rcSmoothing-throttle-manual-select"]').val("0");
$(".tab-receiver .rcSmoothing-throttle-cutoff").hide();
}
$('select[name="rcSmoothing-throttle-manual-select"]')
.on("change", function () {
if ($(this).val() === "0") {
$(".tab-receiver .rcSmoothing-throttle-cutoff").hide();
rcSmoothingThrottleNumberElement.val(0);
}
if ($(this).val() === "1") {
$(".tab-receiver .rcSmoothing-throttle-cutoff").show();
rcSmoothingThrottleNumberElement.val(FC.RX_CONFIG.rcSmoothingThrottleCutoff);
}
})
.trigger("change");
} else {
$(".tab-receiver .rcSmoothing-throttle-cutoff").hide();
const rcSmoothingFeedforwardNumberElement = $('input[name="rcSmoothingFeedforwardCutoff-number"]');

rcSmoothingFeedforwardNumberElement.val(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff);
Expand Down
31 changes: 31 additions & 0 deletions src/tabs/receiver.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,37 @@
</div>
</td>
</tr>

<tr class="rcSmoothing-throttle-manual">
<td>
<select name="rcSmoothing-throttle-manual-select">
<option value="0" i18n="receiverRcSmoothingAuto"></option>
<option value="1" i18n="receiverRcSmoothingManual"></option>
</select>
</td>
<td>
<div>
<label>
<span i18n="receiverThrottleTypeSelect"></span>
</label>
</div>
</td>
<td>
<div class="helpicon cf_tip" i18n_title="receiverRcSmoothingThrottleManual"></div>
</td>
</tr>
<tr class="rcSmoothing-throttle-manual">
<td class="rcSmoothing-throttle-cutoff"><input type="number" name="rcSmoothingThrottleCutoffHz-number" step="1" min="0" max="255"/></td>
<td class="rcSmoothing-throttle-cutoff" colspan="2">
<div>
<label>
<span i18n="receiverRcSmoothingThrottleCutoffHz"></span>
</label>
<div class="helpicon cf_tip" i18n_title="rcSmoothingThrottleCutoffHelp"></div>
</div>
</td>
</tr>

<tr class="rcSmoothing-feedforward-manual">
<td>
<select name="rcSmoothing-feedforward-select">
Expand Down