mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 09:15:49 +03:00
Merge pull request #79 from NightHawk32/NewPIDFunctions
New pid functions
This commit is contained in:
commit
d133c2317c
3 changed files with 21 additions and 22 deletions
|
@ -29,7 +29,7 @@ function configuration_backup(callback) {
|
|||
profileSpecificData.push(MSP_codes.MSP_SERVO_MIX_RULES);
|
||||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
profileSpecificData.push(MSP_codes.MSP_RC_CONTROLS);
|
||||
profileSpecificData.push(MSP_codes.MSP_RC_READBAND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ function configuration_backup(callback) {
|
|||
});
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
configuration.profiles[fetchingProfile].RCcontrols = jQuery.extend(true, {}, RC_controls);
|
||||
configuration.profiles[fetchingProfile].RCreadband = jQuery.extend(true, {}, RC_readband);
|
||||
}
|
||||
codeKey = 0;
|
||||
fetchingProfile++;
|
||||
|
@ -529,16 +529,15 @@ function configuration_restore(callback) {
|
|||
|
||||
|
||||
if (compareVersions(migratedVersion, '0.66.0') && !compareVersions(configuration.apiVersion, '1.15.0')) {
|
||||
// api 1.15 exposes RCcontrols and sensor alignment
|
||||
// api 1.15 exposes RCreadband and sensor alignment
|
||||
|
||||
|
||||
for (var profileIndex = 0; profileIndex < configuration.profiles.length; profileIndex++) {
|
||||
if (configuration.profiles[profileIndex].RCcontrols == undefined) {
|
||||
configuration.profiles[profileIndex].RCcontrols = {
|
||||
if (configuration.profiles[profileIndex].RCreadband == undefined) {
|
||||
configuration.profiles[profileIndex].RCreadband = {
|
||||
deadband: 0,
|
||||
yaw_deadband: 0,
|
||||
alt_hold_deadband: 40,
|
||||
alt_hold_fast_change: 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -614,7 +613,7 @@ function configuration_restore(callback) {
|
|||
];
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
profileSpecificData.push(MSP_codes.MSP_SET_RC_CONTROLS);
|
||||
profileSpecificData.push(MSP_codes.MSP_SET_RC_READBAND);
|
||||
}
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_STATUS, false, false, function () {
|
||||
|
@ -643,7 +642,7 @@ function configuration_restore(callback) {
|
|||
SERVO_RULES = configuration.profiles[profile].ServoRules;
|
||||
MODE_RANGES = configuration.profiles[profile].ModeRanges;
|
||||
ADJUSTMENT_RANGES = configuration.profiles[profile].AdjustmentRanges;
|
||||
RC_controls = configuration.profiles[profile].RCcontrols;
|
||||
RC_readband = configuration.profiles[profile].RCreadband;
|
||||
}
|
||||
|
||||
function upload_using_specific_commands() {
|
||||
|
|
|
@ -179,11 +179,10 @@ var DATAFLASH = {
|
|||
usedSize: 0
|
||||
};
|
||||
|
||||
var RC_controls = {
|
||||
var RC_readband = {
|
||||
deadband: 0,
|
||||
yaw_deadband: 0,
|
||||
alt_hold_deadband: 0,
|
||||
alt_hold_fast_change: 0
|
||||
alt_hold_deadband: 0
|
||||
};
|
||||
|
||||
var SENSOR_ALIGNMENT = {
|
||||
|
|
23
js/msp.js
23
js/msp.js
|
@ -77,7 +77,7 @@ var MSP_codes = {
|
|||
MSP_SET_SERVO_CONFIGURATION: 212,
|
||||
MSP_SET_MOTOR: 214,
|
||||
MSP_SET_3D: 217,
|
||||
MSP_SET_RC_CONTROLS: 218,
|
||||
MSP_SET_RC_READBAND: 218,
|
||||
MSP_SET_RESET_CURR_PID: 219,
|
||||
MSP_SET_SENSOR_ALIGNMENT: 220,
|
||||
|
||||
|
@ -527,10 +527,9 @@ var MSP = {
|
|||
break;
|
||||
case MSP_codes.MSP_RC_READBAND:
|
||||
var offset = 0;
|
||||
RC_controls.deadband = data.getUint8(offset++, 1);
|
||||
RC_controls.yaw_deadband = data.getUint8(offset++, 1);
|
||||
RC_controls.alt_hold_deadband = data.getUint8(offset++, 1);
|
||||
RC_controls.alt_hold_fast_change = data.getUint8(offset++, 1);
|
||||
RC_readband.deadband = data.getUint8(offset++, 1);
|
||||
RC_readband.yaw_deadband = data.getUint8(offset++, 1);
|
||||
RC_readband.alt_hold_deadband = data.getUint8(offset++, 1);
|
||||
break;
|
||||
case MSP_codes.MSP_SENSOR_ALIGNMENT:
|
||||
var offset = 0;
|
||||
|
@ -933,7 +932,10 @@ var MSP = {
|
|||
case MSP_codes.MSP_SET_3D:
|
||||
console.log('3D settings saved');
|
||||
break;
|
||||
case MSP_codes.MSP_SET_SENSOR_ALIGNMENT:
|
||||
case MSP_codes.MSP_SET_RC_READBAND:
|
||||
console.log('Rc controls settings saved');
|
||||
break;
|
||||
case MSP_codes.MSP_SET_SENSOR_ALIGNMENT:
|
||||
console.log('Sensor alignment saved');
|
||||
break;
|
||||
case MSP_codes.MSP_SET_RX_CONFIG:
|
||||
|
@ -1278,11 +1280,10 @@ MSP.crunch = function (code) {
|
|||
buffer.push(highByte(_3D.deadband3d_throttle));
|
||||
break;
|
||||
|
||||
case MSP_codes.MSP_SET_RC_CONTROLS:
|
||||
buffer.push(RC_controls.deadband);
|
||||
buffer.push(RC_controls.yaw_deadband);
|
||||
buffer.push(RC_controls.alt_hold_deadband);
|
||||
buffer.push(RC_controls.alt_hold_fast_change);
|
||||
case MSP_codes.MSP_SET_RC_READBAND:
|
||||
buffer.push(RC_readband.deadband);
|
||||
buffer.push(RC_readband.yaw_deadband);
|
||||
buffer.push(RC_readband.alt_hold_deadband);
|
||||
break;
|
||||
|
||||
case MSP_codes.MSP_SET_SENSOR_ALIGNMENT:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue