1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Backend for Notch filters settings over MSP

This commit is contained in:
U-PAWEL-X220\pawel 2017-01-05 21:54:33 +01:00
parent a81cc99d11
commit c5556f2f40
2 changed files with 27 additions and 21 deletions

View file

@ -237,7 +237,13 @@ var FC = {
FILTER_CONFIG = { FILTER_CONFIG = {
gyroSoftLpfHz: null, gyroSoftLpfHz: null,
dtermLpfHz: null, dtermLpfHz: null,
yawLpfHz: null yawLpfHz: null,
gyroNotchHz1: null,
gyroNotchCutoff1: null,
dtermNotchHz: null,
dtermNotchCutoff: null,
gyroNotchHz2: null,
gyroNotchCutoff2: null
}; };
PID_ADVANCED = { PID_ADVANCED = {

View file

@ -812,14 +812,14 @@ var mspHelper = (function (gui) {
FILTER_CONFIG.gyroSoftLpfHz = data.getUint8(0, true); FILTER_CONFIG.gyroSoftLpfHz = data.getUint8(0, true);
FILTER_CONFIG.dtermLpfHz = data.getUint16(1, true); FILTER_CONFIG.dtermLpfHz = data.getUint16(1, true);
FILTER_CONFIG.yawLpfHz = data.getUint16(3, true); FILTER_CONFIG.yawLpfHz = data.getUint16(3, true);
/*
sbufWriteU16(dst, 1); //masterConfig.gyro_soft_notch_hz_1 FILTER_CONFIG.gyroNotchHz1 = data.getUint16(5, true);
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_cutoff_1 FILTER_CONFIG.gyroNotchCutoff1 = data.getUint16(7, true);
sbufWriteU16(dst, 1); //BF: currentProfile->pidProfile.dterm_notch_hz FILTER_CONFIG.dtermNotchHz = data.getUint16(9, true);
sbufWriteU16(dst, 1); //currentProfile->pidProfile.dterm_notch_cutoff FILTER_CONFIG.dtermNotchCutoff = data.getUint16(11, true);
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_hz_2 FILTER_CONFIG.gyroNotchHz2 = data.getUint16(13, true);
sbufWriteU16(dst, 1); //BF: masterConfig.gyro_soft_notch_cutoff_2 FILTER_CONFIG.gyroNotchCutoff2 = data.getUint16(15, true);
*/
break; break;
case MSPCodes.MSP_SET_FILTER_CONFIG: case MSPCodes.MSP_SET_FILTER_CONFIG:
@ -1218,23 +1218,23 @@ var mspHelper = (function (gui) {
buffer.push(lowByte(FILTER_CONFIG.yawLpfHz)); buffer.push(lowByte(FILTER_CONFIG.yawLpfHz));
buffer.push(highByte(FILTER_CONFIG.yawLpfHz)); buffer.push(highByte(FILTER_CONFIG.yawLpfHz));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.gyroNotchHz1));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.gyroNotchHz1));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.gyroNotchCutoff1));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.gyroNotchCutoff1));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.dtermNotchHz));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.dtermNotchHz));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.dtermNotchCutoff));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.dtermNotchCutoff));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.gyroNotchHz2));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.gyroNotchHz2));
buffer.push(0); buffer.push(lowByte(FILTER_CONFIG.gyroNotchCutoff2));
buffer.push(0); buffer.push(highByte(FILTER_CONFIG.gyroNotchCutoff2));
break; break;
case MSPCodes.MSP_SET_PID_ADVANCED: case MSPCodes.MSP_SET_PID_ADVANCED: