1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Merge pull request #566 from basdelfos/copy-profile

Added copy profile to another profile in PID Tuning tab
This commit is contained in:
borisbstyle 2017-08-06 21:58:25 +02:00 committed by GitHub
commit e0438d2e8c
7 changed files with 215 additions and 4 deletions

View file

@ -55,6 +55,7 @@ var PID_ADVANCED_CONFIG;
var FILTER_CONFIG;
var ADVANCED_TUNING;
var SENSOR_CONFIG;
var COPY_PROFILE;
var FC = {
resetState: function() {
@ -81,12 +82,18 @@ var FC = {
};
BF_CONFIG = {
currentscale: 0,
currentoffset: 0,
currentmetertype: 0,
batterycapacity: 0,
currentscale: 0,
currentoffset: 0,
currentmetertype: 0,
batterycapacity: 0,
};
COPY_PROFILE = {
type: 0,
dstProfile: 0,
srcProfile: 0,
};
FEATURE_CONFIG = {
features: 0,
};

View file

@ -117,6 +117,8 @@ var MSPCodes = {
MSP_DISPLAYPORT: 182,
MSP_COPY_PROFILE: 183,
MSP_BEEPER_CONFIG: 184,
MSP_SET_BEEPER_CONFIG: 185,

View file

@ -1138,6 +1138,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
case MSPCodes.MSP_SET_SENSOR_CONFIG:
console.log('Sensor config parameters set');
break;
case MSPCodes.MSP_COPY_PROFILE:
console.log('Copy profile');
break;
default:
console.log('Unknown code detected: ' + code);
} else {
@ -1494,6 +1497,12 @@ MspHelper.prototype.crunch = function(code) {
}
break;
case MSPCodes.MSP_COPY_PROFILE:
buffer.push8(COPY_PROFILE.type)
.push8(COPY_PROFILE.dstProfile)
.push8(COPY_PROFILE.srcProfile)
break;
default:
return false;
}