1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 04:45:20 +03:00

Replace API versions by constants

This commit is contained in:
Miguel Angel Mulero Martinez 2020-10-15 08:47:55 +02:00
parent 7fcc9efc72
commit fd35031e6f
25 changed files with 315 additions and 301 deletions

View file

@ -116,13 +116,13 @@ function configuration_backup(callback) {
if (semver.gte(FC.CONFIG.apiVersion, "1.19.0")) {
uniqueData.push(MSPCodes.MSP_LED_STRIP_MODECOLOR);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.33.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_33)) {
uniqueData.push(MSPCodes.MSP_MOTOR_CONFIG);
uniqueData.push(MSPCodes.MSP_RSSI_CONFIG);
uniqueData.push(MSPCodes.MSP_GPS_CONFIG);
uniqueData.push(MSPCodes.MSP_FEATURE_CONFIG);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.41.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_41)) {
uniqueData.push(MSPCodes.MSP_MODE_RANGES_EXTRA);
}
}
@ -166,16 +166,16 @@ function configuration_backup(callback) {
configuration.FAILSAFE_CONFIG = jQuery.extend(true, {}, FC.FAILSAFE_CONFIG);
configuration.RXFAIL_CONFIG = jQuery.extend(true, [], FC.RXFAIL_CONFIG);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.33.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_33)) {
configuration.RSSI_CONFIG = jQuery.extend(true, {}, FC.RSSI_CONFIG);
configuration.FEATURE_CONFIG = jQuery.extend(true, {}, FC.FEATURE_CONFIG);
configuration.MOTOR_CONFIG = jQuery.extend(true, {}, FC.MOTOR_CONFIG);
configuration.GPS_CONFIG = jQuery.extend(true, {}, FC.GPS_CONFIG);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.36.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
configuration.BEEPER_CONFIG = jQuery.extend(true, {}, FC.BEEPER_CONFIG);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.41.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_41)) {
configuration.MODE_RANGES_EXTRA = jQuery.extend(true, [], FC.MODE_RANGES_EXTRA);
}
@ -768,7 +768,7 @@ function configuration_restore(callback) {
}
function upload_mode_ranges() {
if (semver.gte(FC.CONFIG.apiVersion, "1.41.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_41)) {
if (configuration.MODE_RANGES_EXTRA == undefined) {
FC.MODE_RANGES_EXTRA = [];
@ -824,7 +824,7 @@ function configuration_restore(callback) {
uniqueData.push(MSPCodes.MSP_SET_RX_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_FAILSAFE_CONFIG);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.33.0")) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_33)) {
uniqueData.push(MSPCodes.MSP_SET_FEATURE_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_MOTOR_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_GPS_CONFIG);