1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Support for 16-bit DTerm Setpoint Weight

This commit is contained in:
Cleric-K 2018-06-06 00:22:32 +03:00
parent 5f68d5982c
commit 6a4e605506
4 changed files with 13 additions and 3 deletions

View file

@ -864,6 +864,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
ADVANCED_TUNING.itermThrottleThreshold = data.readU16();
ADVANCED_TUNING.itermAcceleratorGain = data.readU16();
}
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
ADVANCED_TUNING.dtermSetpointWeight = data.readU16();
}
}
break;
case MSPCodes.MSP_SENSOR_CONFIG:
@ -1479,7 +1482,7 @@ MspHelper.prototype.crunch = function(code) {
.push8(ADVANCED_TUNING.deltaMethod)
.push8(ADVANCED_TUNING.vbatPidCompensation)
.push8(ADVANCED_TUNING.dtermSetpointTransition)
.push8(ADVANCED_TUNING.dtermSetpointWeight)
.push8(Math.min(ADVANCED_TUNING.dtermSetpointWeight, 254))
.push8(ADVANCED_TUNING.toleranceBand)
.push8(ADVANCED_TUNING.toleranceBandReduction)
.push8(ADVANCED_TUNING.itermThrottleGain)
@ -1493,6 +1496,9 @@ MspHelper.prototype.crunch = function(code) {
buffer.push16(ADVANCED_TUNING.itermThrottleThreshold)
.push16(ADVANCED_TUNING.itermAcceleratorGain);
}
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
buffer.push16(ADVANCED_TUNING.dtermSetpointWeight);
}
}
// only supports 1 version pre bf 3.0
else {