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

Removed unused compass declination setting.

This commit is contained in:
mikeller 2020-05-02 23:16:06 +12:00
parent 091ce5b591
commit 59cb2d29a0
8 changed files with 9 additions and 68 deletions

View file

@ -828,9 +828,6 @@
"initialSetupMagHead": { "initialSetupMagHead": {
"message": "Magnetometer" "message": "Magnetometer"
}, },
"initialSetupDeclination": {
"message": "Declination:"
},
"initialSetupInfoHead": { "initialSetupInfoHead": {
"message": "Info" "message": "Info"
}, },
@ -1232,9 +1229,6 @@
"configurationArmingHelp": { "configurationArmingHelp": {
"message": "Some Arming options may require accelerometer be enabled" "message": "Some Arming options may require accelerometer be enabled"
}, },
"configurationMagDeclination": {
"message": "Magnetometer Declination [deg]"
},
"configurationReverseMotorSwitch": { "configurationReverseMotorSwitch": {
"message": "Motor direction is reversed" "message": "Motor direction is reversed"
}, },

View file

@ -120,7 +120,6 @@ function configuration_backup(callback) {
uniqueData.push(MSPCodes.MSP_MOTOR_CONFIG); uniqueData.push(MSPCodes.MSP_MOTOR_CONFIG);
uniqueData.push(MSPCodes.MSP_RSSI_CONFIG); uniqueData.push(MSPCodes.MSP_RSSI_CONFIG);
uniqueData.push(MSPCodes.MSP_GPS_CONFIG); uniqueData.push(MSPCodes.MSP_GPS_CONFIG);
uniqueData.push(MSPCodes.MSP_COMPASS_CONFIG);
uniqueData.push(MSPCodes.MSP_FEATURE_CONFIG); uniqueData.push(MSPCodes.MSP_FEATURE_CONFIG);
} }
if (semver.gte(CONFIG.apiVersion, "1.41.0")) { if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
@ -172,7 +171,6 @@ function configuration_backup(callback) {
configuration.FEATURE_CONFIG = jQuery.extend(true, {}, FEATURE_CONFIG); configuration.FEATURE_CONFIG = jQuery.extend(true, {}, FEATURE_CONFIG);
configuration.MOTOR_CONFIG = jQuery.extend(true, {}, MOTOR_CONFIG); configuration.MOTOR_CONFIG = jQuery.extend(true, {}, MOTOR_CONFIG);
configuration.GPS_CONFIG = jQuery.extend(true, {}, GPS_CONFIG); configuration.GPS_CONFIG = jQuery.extend(true, {}, GPS_CONFIG);
configuration.COMPASS_CONFIG = jQuery.extend(true, {}, COMPASS_CONFIG);
} }
if (semver.gte(CONFIG.apiVersion, "1.36.0")) { if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
configuration.BEEPER_CONFIG = jQuery.extend(true, {}, BEEPER_CONFIG); configuration.BEEPER_CONFIG = jQuery.extend(true, {}, BEEPER_CONFIG);
@ -829,7 +827,6 @@ function configuration_restore(callback) {
uniqueData.push(MSPCodes.MSP_SET_FEATURE_CONFIG); uniqueData.push(MSPCodes.MSP_SET_FEATURE_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_MOTOR_CONFIG); uniqueData.push(MSPCodes.MSP_SET_MOTOR_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_GPS_CONFIG); uniqueData.push(MSPCodes.MSP_SET_GPS_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_COMPASS_CONFIG);
uniqueData.push(MSPCodes.MSP_SET_RSSI_CONFIG); uniqueData.push(MSPCodes.MSP_SET_RSSI_CONFIG);
} }
} }
@ -851,7 +848,6 @@ function configuration_restore(callback) {
FEATURE_CONFIG = configuration.FEATURE_CONFIG; FEATURE_CONFIG = configuration.FEATURE_CONFIG;
MOTOR_CONFIG = configuration.MOTOR_CONFIG; MOTOR_CONFIG = configuration.MOTOR_CONFIG;
GPS_CONFIG = configuration.GPS_CONFIG; GPS_CONFIG = configuration.GPS_CONFIG;
COMPASS_CONFIG = configuration.COMPASS_CONFIG;
RSSI_CONFIG = configuration.RSSI_CONFIG; RSSI_CONFIG = configuration.RSSI_CONFIG;
BOARD_ALIGNMENT_CONFIG = configuration.BOARD_ALIGNMENT_CONFIG; BOARD_ALIGNMENT_CONFIG = configuration.BOARD_ALIGNMENT_CONFIG;
CONFIG.name = configuration.CRAFT_NAME; CONFIG.name = configuration.CRAFT_NAME;

View file

@ -42,7 +42,6 @@ var FC_CONFIG;
var MISC; // DEPRECATED var MISC; // DEPRECATED
var MOTOR_CONFIG; var MOTOR_CONFIG;
var GPS_CONFIG; var GPS_CONFIG;
var COMPASS_CONFIG;
var RSSI_CONFIG; var RSSI_CONFIG;
var MOTOR_3D_CONFIG; var MOTOR_3D_CONFIG;
var DATAFLASH; var DATAFLASH;
@ -311,10 +310,6 @@ var FC = {
ublox_use_galileo: 0, ublox_use_galileo: 0,
}; };
COMPASS_CONFIG = {
mag_declination: 0,
};
RSSI_CONFIG = { RSSI_CONFIG = {
channel: 0, channel: 0,
}; };

View file

@ -109,7 +109,7 @@ var MSPCodes = {
MSP_BATTERY_STATE: 130, MSP_BATTERY_STATE: 130,
MSP_MOTOR_CONFIG: 131, MSP_MOTOR_CONFIG: 131,
MSP_GPS_CONFIG: 132, MSP_GPS_CONFIG: 132,
MSP_COMPASS_CONFIG: 133, // Removed: MSP_COMPASS_CONFIG: 133,
MSP_GPS_RESCUE: 135, MSP_GPS_RESCUE: 135,
MSP_VTXTABLE_BAND: 137, MSP_VTXTABLE_BAND: 137,
@ -150,7 +150,7 @@ var MSPCodes = {
MSP_SET_LED_STRIP_MODECOLOR: 221, MSP_SET_LED_STRIP_MODECOLOR: 221,
MSP_SET_MOTOR_CONFIG: 222, MSP_SET_MOTOR_CONFIG: 222,
MSP_SET_GPS_CONFIG: 223, MSP_SET_GPS_CONFIG: 223,
MSP_SET_COMPASS_CONFIG: 224, // Removed: MSP_SET_COMPASS_CONFIG: 224,
MSP_SET_GPS_RESCUE: 225, MSP_SET_GPS_RESCUE: 225,
MSP_SET_VTXTABLE_BAND: 227, MSP_SET_VTXTABLE_BAND: 227,

View file

@ -398,10 +398,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
MISC.multiwiicurrentoutput = data.readU8(); MISC.multiwiicurrentoutput = data.readU8();
RSSI_CONFIG.channel = data.readU8(); RSSI_CONFIG.channel = data.readU8();
MISC.placeholder2 = data.readU8(); MISC.placeholder2 = data.readU8();
if (semver.lt(CONFIG.apiVersion, "1.18.0")) data.read16(); // was mag_declination
COMPASS_CONFIG.mag_declination = data.read16() / 10; // -1800-1800
else
COMPASS_CONFIG.mag_declination = data.read16() / 100; // -18000-18000
MISC.vbatscale = data.readU8(); // was MISC.vbatscale - 10-200 MISC.vbatscale = data.readU8(); // was MISC.vbatscale - 10-200
MISC.vbatmincellvoltage = data.readU8() / 10; // 10-50 MISC.vbatmincellvoltage = data.readU8() / 10; // 10-50
MISC.vbatmaxcellvoltage = data.readU8() / 10; // 10-50 MISC.vbatmaxcellvoltage = data.readU8() / 10; // 10-50
@ -418,9 +415,6 @@ MspHelper.prototype.process_data = function(dataHandler) {
MOTOR_CONFIG.use_esc_sensor = data.readU8() != 0; MOTOR_CONFIG.use_esc_sensor = data.readU8() != 0;
} }
break; break;
case MSPCodes.MSP_COMPASS_CONFIG:
COMPASS_CONFIG.mag_declination = data.read16() / 100; // -18000-18000
break;
case MSPCodes.MSP_GPS_CONFIG: case MSPCodes.MSP_GPS_CONFIG:
GPS_CONFIG.provider = data.readU8(); GPS_CONFIG.provider = data.readU8();
GPS_CONFIG.ublox_sbas = data.readU8(); GPS_CONFIG.ublox_sbas = data.readU8();
@ -1730,13 +1724,9 @@ MspHelper.prototype.crunch = function(code) {
.push8(GPS_CONFIG.ublox_sbas) .push8(GPS_CONFIG.ublox_sbas)
.push8(MISC.multiwiicurrentoutput) .push8(MISC.multiwiicurrentoutput)
.push8(RSSI_CONFIG.channel) .push8(RSSI_CONFIG.channel)
.push8(MISC.placeholder2); .push8(MISC.placeholder2)
if (semver.lt(CONFIG.apiVersion, "1.18.0")) { .push16(0) // was mag_declination
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 10)); .push8(MISC.vbatscale)
} else {
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
}
buffer.push8(MISC.vbatscale)
.push8(Math.round(MISC.vbatmincellvoltage * 10)) .push8(Math.round(MISC.vbatmincellvoltage * 10))
.push8(Math.round(MISC.vbatmaxcellvoltage * 10)) .push8(Math.round(MISC.vbatmaxcellvoltage * 10))
.push8(Math.round(MISC.vbatwarningcellvoltage * 10)); .push8(Math.round(MISC.vbatwarningcellvoltage * 10));
@ -1781,9 +1771,6 @@ MspHelper.prototype.crunch = function(code) {
.push8(GPS_RESCUE.altitudeMode); .push8(GPS_RESCUE.altitudeMode);
} }
break; break;
case MSPCodes.MSP_SET_COMPASS_CONFIG:
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
break;
case MSPCodes.MSP_SET_RSSI_CONFIG: case MSPCodes.MSP_SET_RSSI_CONFIG:
buffer.push8(RSSI_CONFIG.channel); buffer.push8(RSSI_CONFIG.channel);
break; break;

View file

@ -54,18 +54,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
function load_motor_config() { function load_motor_config() {
var next_callback = load_compass_config;
if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, next_callback);
} else {
next_callback();
}
}
function load_compass_config() {
var next_callback = load_gps_config; var next_callback = load_gps_config;
if(semver.gte(CONFIG.apiVersion, "1.33.0")) { if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
MSP.send_message(MSPCodes.MSP_COMPASS_CONFIG, false, false, load_gps_config); MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, next_callback);
} else { } else {
next_callback(); next_callback();
} }
@ -930,9 +921,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="roll"]').val(CONFIG.accelerometerTrims[1]); $('input[name="roll"]').val(CONFIG.accelerometerTrims[1]);
$('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]); $('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]);
// fill magnetometer
$('input[name="mag_declination"]').val(COMPASS_CONFIG.mag_declination.toFixed(2));
//fill motor disarm params and FC loop time //fill motor disarm params and FC loop time
if(semver.gte(CONFIG.apiVersion, "1.8.0")) { if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
$('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay); $('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay);
@ -1192,7 +1180,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val()); CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val());
CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val()); CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val());
COMPASS_CONFIG.mag_declination = parseFloat($('input[name="mag_declination"]').val());
// motor disarm // motor disarm
if(semver.gte(CONFIG.apiVersion, "1.8.0")) { if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
@ -1314,18 +1301,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0; GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0;
} }
var next_callback = save_compass_config;
if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
MSP.send_message(MSPCodes.MSP_SET_GPS_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_GPS_CONFIG), false, next_callback);
} else {
next_callback();
}
}
function save_compass_config() {
var next_callback = save_motor_3d_config; var next_callback = save_motor_3d_config;
if(semver.gte(CONFIG.apiVersion, "1.33.0")) { if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
MSP.send_message(MSPCodes.MSP_SET_COMPASS_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_COMPASS_CONFIG), false, next_callback); MSP.send_message(MSPCodes.MSP_SET_GPS_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_GPS_CONFIG), false, next_callback);
} else { } else {
next_callback(); next_callback();
} }

View file

@ -55,11 +55,7 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
} }
function load_motor_config() { function load_motor_config() {
MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, load_compass_config); MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, load_gps_config);
}
function load_compass_config() {
MSP.send_message(MSPCodes.MSP_COMPASS_CONFIG, false, false, load_gps_config);
} }
function load_gps_config() { function load_gps_config() {

View file

@ -588,11 +588,6 @@
</select> </select>
<span i18n="configurationGPSubxSbas"></span> <span i18n="configurationGPSubxSbas"></span>
</div> </div>
<div class="number">
<label> <input type="number" name="mag_declination" step="0.01" min="-180" max="180" />
<span i18n="configurationMagDeclination"></span>
</label>
</div>
</div> </div>
</div> </div>
</div> </div>