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

Fix 3D support.

Add missing backup and restore functionalty
Add missing configuration migration logic
Add missing visibility toggling of 3D section when API version <
`1.14.0`
Add missing logic for issuing the correct sequence of MSP commands
issues when API version < `1.14.0` when viewing the configuration tab.
This commit is contained in:
Dominic Clifton 2015-11-16 22:28:21 +00:00
parent 253aca72a4
commit ec57aa9d1a
2 changed files with 59 additions and 15 deletions

View file

@ -15,10 +15,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function load_serial_config() {
var next_callback = load_rc_map;
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, load_rc_map);
MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, next_callback);
} else {
load_rc_map();
next_callback();
}
}
@ -27,24 +28,38 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function load_misc() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_3d);
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim);
}
function load_3d() {
MSP.send_message(MSP_codes.MSP_3D, false, false, load_acc_trim);
}
function load_acc_trim() {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false
, semver.gte(CONFIG.apiVersion, "1.8.0") ? load_arming_config : load_html);
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_arming_config);
}
function load_arming_config() {
MSP.send_message(MSP_codes.MSP_ARMING_CONFIG, false, false, load_loop_time);
var next_callback = load_loop_time;
if (semver.gte(CONFIG.apiVersion, "1.8.0")) {
MSP.send_message(MSP_codes.MSP_ARMING_CONFIG, false, false, next_callback);
} else {
next_callback();
}
}
function load_loop_time() {
MSP.send_message(MSP_codes.MSP_LOOP_TIME, false, false, load_html);
var next_callback = load_3d;
if (semver.gte(CONFIG.apiVersion, "1.8.0")) {
MSP.send_message(MSP_codes.MSP_LOOP_TIME, false, false, next_callback);
} else {
next_callback();
}
}
function load_3d() {
var next_callback = load_html;
if (semver.lt(CONFIG.apiVersion, "1.14.0")) {
MSP.send_message(MSP_codes.MSP_3D, false, false, next_callback);
} else {
next_callback();
}
}
function load_html() {
@ -318,10 +333,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
//fill 3D
$('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low);
$('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high);
$('input[name="3dneutral"]').val(_3D.neutral3d);
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
if (semver.lt(CONFIG.apiVersion, "1.14.0")) {
$('.tab-configuration .3d').hide();
} else {
$('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low);
$('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high);
$('input[name="3dneutral"]').val(_3D.neutral3d);
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
}
// UI hooks
$('input[name="looptime"]').change(function() {