mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 21:35:33 +03:00
Added new filters to MSP.
This commit is contained in:
parent
838ab954f1
commit
d981bc42d5
2 changed files with 22 additions and 1 deletions
6
js/fc.js
6
js/fc.js
|
@ -259,7 +259,11 @@ var FC = {
|
||||||
FILTER_CONFIG = {
|
FILTER_CONFIG = {
|
||||||
gyro_soft_lpf_hz: 0,
|
gyro_soft_lpf_hz: 0,
|
||||||
dterm_lpf_hz: 0,
|
dterm_lpf_hz: 0,
|
||||||
yaw_lpf_hz: 0
|
yaw_lpf_hz: 0,
|
||||||
|
gyro_soft_notch_hz: 0,
|
||||||
|
gyro_soft_notch_cutoff: 0,
|
||||||
|
dterm_notch_hz: 0,
|
||||||
|
dterm_notch_cutoff: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_TUNING = {
|
ADVANCED_TUNING = {
|
||||||
|
|
|
@ -681,6 +681,17 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
FILTER_CONFIG.dterm_lpf_hz = data.getUint16(offset, 1);
|
FILTER_CONFIG.dterm_lpf_hz = data.getUint16(offset, 1);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
FILTER_CONFIG.yaw_lpf_hz = data.getUint16(offset, 1);
|
FILTER_CONFIG.yaw_lpf_hz = data.getUint16(offset, 1);
|
||||||
|
offset += 2;
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
|
||||||
|
FILTER_CONFIG.gyro_soft_notch_hz = data.getUint16(offset, 1);
|
||||||
|
offset += 2;
|
||||||
|
FILTER_CONFIG.gyro_soft_notch_cutoff = data.getUint16(offset, 1);
|
||||||
|
offset += 2;
|
||||||
|
FILTER_CONFIG.dterm_notch_hz = data.getUint16(offset, 1);
|
||||||
|
offset += 2;
|
||||||
|
FILTER_CONFIG.dterm_notch_cutoff = data.getUint16(offset, 1);
|
||||||
|
offset += 2;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP_PID_ADVANCED:
|
case MSPCodes.MSP_PID_ADVANCED:
|
||||||
|
@ -1313,6 +1324,12 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
buffer.push8(FILTER_CONFIG.gyro_soft_lpf_hz)
|
buffer.push8(FILTER_CONFIG.gyro_soft_lpf_hz)
|
||||||
.push16(FILTER_CONFIG.dterm_lpf_hz)
|
.push16(FILTER_CONFIG.dterm_lpf_hz)
|
||||||
.push16(FILTER_CONFIG.yaw_lpf_hz);
|
.push16(FILTER_CONFIG.yaw_lpf_hz);
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
|
||||||
|
buffer.push16(FILTER_CONFIG.gyro_soft_notch_hz)
|
||||||
|
.push16(FILTER_CONFIG.gyro_soft_notch_cutoff)
|
||||||
|
.push16(FILTER_CONFIG.dterm_notch_hz)
|
||||||
|
.push16(FILTER_CONFIG.dterm_notch_cutoff);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_PID_ADVANCED:
|
case MSPCodes.MSP_SET_PID_ADVANCED:
|
||||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue