mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 21:05:30 +03:00
Adding rc smoothing
This commit is contained in:
parent
25b49fb79f
commit
5a6b277778
6 changed files with 437 additions and 25 deletions
|
@ -764,6 +764,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
RX_CONFIG.spektrum_sat_bind = data.readU8();
|
||||
RX_CONFIG.rx_min_usec = data.readU16();
|
||||
RX_CONFIG.rx_max_usec = data.readU16();
|
||||
RX_CONFIG.rcInterpolation = 0;
|
||||
RX_CONFIG.rcInterpolationInterval = 0;
|
||||
RX_CONFIG.airModeActivateThreshold = 0;
|
||||
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
|
||||
RX_CONFIG.rcInterpolation = data.readU8();
|
||||
RX_CONFIG.rcInterpolationInterval = data.readU8();
|
||||
|
@ -773,16 +776,15 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
RX_CONFIG.rxSpiId = data.readU32();
|
||||
RX_CONFIG.rxSpiRfChannelCount = data.readU8();
|
||||
RX_CONFIG.fpvCamAngleDegrees = data.readU8();
|
||||
} else {
|
||||
RX_CONFIG.rxSpiProtocol = 0;
|
||||
RX_CONFIG.rxSpiId = 0;
|
||||
RX_CONFIG.rxSpiRfChannelCount = 0;
|
||||
RX_CONFIG.fpvCamAngleDegrees = 0;
|
||||
if (semver.gte(CONFIG.apiVersion, "1.40.0")) {
|
||||
RX_CONFIG.rcInterpolationChannels = data.readU8();
|
||||
RX_CONFIG.rcSmoothingType = data.readU8();
|
||||
RX_CONFIG.rcSmoothingInputCutoff = data.readU8();
|
||||
RX_CONFIG.rcSmoothingDerivativeCutoff = data.readU8();
|
||||
RX_CONFIG.rcSmoothingInputType = data.readU8();
|
||||
RX_CONFIG.rcSmoothingDerivativeType = data.readU8();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RX_CONFIG.rcInterpolation = 0;
|
||||
RX_CONFIG.rcInterpolationInterval = 0;
|
||||
RX_CONFIG.airModeActivateThreshold = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1360,6 +1362,7 @@ MspHelper.prototype.crunch = function(code) {
|
|||
.push16(BF_CONFIG.batterycapacity)
|
||||
}
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP_SET_RX_CONFIG:
|
||||
buffer.push8(RX_CONFIG.serialrx_provider)
|
||||
.push16(RX_CONFIG.stick_max)
|
||||
|
@ -1377,6 +1380,14 @@ MspHelper.prototype.crunch = function(code) {
|
|||
.push32(RX_CONFIG.rxSpiId)
|
||||
.push8(RX_CONFIG.rxSpiRfChannelCount)
|
||||
.push8(RX_CONFIG.fpvCamAngleDegrees);
|
||||
if (semver.gte(CONFIG.apiVersion, "1.40.0")) {
|
||||
buffer.push8(RX_CONFIG.rcInterpolationChannels)
|
||||
.push8(RX_CONFIG.rcSmoothingType)
|
||||
.push8(RX_CONFIG.rcSmoothingInputCutoff)
|
||||
.push8(RX_CONFIG.rcSmoothingDerivativeCutoff)
|
||||
.push8(RX_CONFIG.rcSmoothingInputType)
|
||||
.push8(RX_CONFIG.rcSmoothingDerivativeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue