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

MSP layer

This commit is contained in:
Pawel Spychalski (DzikuVx) 2023-10-08 18:08:58 +02:00
parent 0435eb732b
commit 4b2e6e3777
3 changed files with 53 additions and 1 deletions

View file

@ -551,6 +551,18 @@ var FC = {
weightCenter: null,
weightEnd: null
};
EZ_TUNE = {
enabled: null,
filterHz: null,
axisRatio: null,
response: null,
damping: null,
stability: null,
aggressiveness: null,
rate: null,
expo: null
};
},
getOutputUsages: function() {
return {

View file

@ -240,5 +240,8 @@ var MSPCodes = {
MSP2_INAV_SET_LED_STRIP_CONFIG_EX: 0x2049,
MSP2_INAV_RATE_DYNAMICS: 0x2060,
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061,
MSP2_INAV_EZ_TUNE: 0x2070,
MSP2_INAV_EZ_TUNE_SET: 0x2071
};

View file

@ -1571,6 +1571,22 @@ var mspHelper = (function (gui) {
console.log('Rate dynamics saved');
break;
case MSPCodes.MSP2_INAV_EZ_TUNE:
EZ_TUNE.enabled = data.getUint8(0);
EZ_TUNE.filterHz = data.getUint16(1, true);
EZ_TUNE.axisRatio = data.getUint8(3);
EZ_TUNE.response = data.getUint8(4);
EZ_TUNE.damping = data.getUint8(5);
EZ_TUNE.stability = data.getUint8(6);
EZ_TUNE.aggressiveness = data.getUint8(7);
EZ_TUNE.rate = data.getUint8(8);
EZ_TUNE.expo = data.getUint8(9);
break;
case MSPCodes.MSP2_INAV_EZ_TUNE_SET:
console.log('Rate dynamics saved');
break;
default:
console.log('Unknown code detected: ' + dataHandler.code);
} else {
@ -2207,6 +2223,19 @@ var mspHelper = (function (gui) {
buffer.push(RATE_DYNAMICS.weightEnd);
break;
case MSPCodes.MSP2_INAV_EZ_TUNE_SET:
buffer.push(EZ_TUNE.enabled);
buffer.push(lowByte(EZ_TUNE.filterHz));
buffer.push(highByte(EZ_TUNE.filterHz));
buffer.push(EZ_TUNE.axisRatio);
buffer.push(EZ_TUNE.response);
buffer.push(EZ_TUNE.damping);
buffer.push(EZ_TUNE.stability);
buffer.push(EZ_TUNE.aggressiveness);
buffer.push(EZ_TUNE.rate);
buffer.push(EZ_TUNE.expo);
default:
return false;
}
@ -3409,6 +3438,14 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS, mspHelper.crunch(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS), false, callback);
}
self.loadEzTune = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_EZ_TUNE, false, false, callback);
}
self.saveEzTune = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_EZ_TUNE_SET, mspHelper.crunch(MSPCodes.MSP2_INAV_EZ_TUNE_SET), false, callback);
}
self.loadParameterGroups = function (callback) {
MSP.send_message(MSPCodes.MSP2_COMMON_PG_LIST, false, false, function (resp) {
var groups = [];