call special params or pid advanced depending on the api version
parent
c138b7f39f
commit
00e89a1dae
1
js/fc.js
1
js/fc.js
|
@ -39,6 +39,7 @@ var FAILSAFE_CONFIG;
|
|||
var RXFAIL_CONFIG;
|
||||
var PID_ADVANCED_CONFIG;
|
||||
var FILTER_CONFIG;
|
||||
var SPECIAL_PARAMETERS;
|
||||
var ADVANCED_TUNING;
|
||||
var SENSOR_CONFIG;
|
||||
|
||||
|
|
|
@ -694,28 +694,27 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
PID.controller = pidController_e.val();
|
||||
promise = MSP.promise(MSP_codes.MSP_SET_PID_CONTROLLER, MSP.crunch(MSP_codes.MSP_SET_PID_CONTROLLER));
|
||||
}
|
||||
|
||||
return promise;
|
||||
}).then(function () {
|
||||
return MSP.promise(MSP_codes.MSP_SET_PID, MSP.crunch(MSP_codes.MSP_SET_PID));
|
||||
}).then(function () {
|
||||
return MSP.promise(MSP_codes.MSP_SET_PID_ADVANCED, MSP.crunch(MSP_codes.MSP_SET_PID_ADVANCED));
|
||||
}).then(function () {
|
||||
var promise;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.1")) {
|
||||
promise = MSP.promise(MSP_codes.MSP_SET_FILTER_CONFIG, MSP.crunch(MSP_codes.MSP_SET_FILTER_CONFIG));
|
||||
if (semver.gte(CONFIG.apiVersion, "2.9.0") && smver.lte(CONFIG.apiVersion, "3.0.0")) {
|
||||
return MSP.promise(MSP_codes.MSP_SET_SPECIAL_PARAMETERS, MSP.crunch(MSP_codes.MSP_SET_SPECIAL_PARAMETERS));
|
||||
}
|
||||
}).then(function () {
|
||||
if (semver.gte(CONFIG.apiVersion, "3.0.0")) {
|
||||
return MSP.promise(MSP_codes.MSP_SET_PID_ADVANCED, MSP.crunch(MSP_codes.MSP_SET_PID_ADVANCED));
|
||||
}
|
||||
}).then(function () {
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.1")) {
|
||||
return MSP.promise(MSP_codes.MSP_SET_FILTER_CONFIG, MSP.crunch(MSP_codes.MSP_SET_FILTER_CONFIG));
|
||||
}
|
||||
|
||||
return promise;
|
||||
}).then(function () {
|
||||
return MSP.promise(MSP_codes.MSP_SET_RC_TUNING, MSP.crunch(MSP_codes.MSP_SET_RC_TUNING));
|
||||
}).then(function () {
|
||||
var promise;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.8.0")) {
|
||||
promise = MSP.promise(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG));
|
||||
return MSP.promise(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG));
|
||||
}
|
||||
|
||||
return promise;
|
||||
}).then(function () {
|
||||
return MSP.promise(MSP_codes.MSP_EEPROM_WRITE);
|
||||
}).then(function () {
|
||||
|
|
Loading…
Reference in New Issue