mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
utilizing new MSP callback api
this resolves a lot of underlying bugs, however bug that causes failed initialization after leaving CLI tab and entering Servo tab is still there.
This commit is contained in:
parent
fbc886787d
commit
474a610a30
1 changed files with 78 additions and 76 deletions
|
@ -1,14 +1,15 @@
|
||||||
function tab_initialize_servos() {
|
function tab_initialize_servos() {
|
||||||
ga_tracker.sendAppView('Servos');
|
ga_tracker.sendAppView('Servos');
|
||||||
|
|
||||||
// request current Servos Config
|
|
||||||
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT);
|
|
||||||
send_message(MSP_codes.MSP_SERVO_CONF, MSP_codes.MSP_SERVO_CONF);
|
|
||||||
|
|
||||||
var model = $('div.tab-servos strong.model');
|
var model = $('div.tab-servos strong.model');
|
||||||
var servos = [];
|
var servos = [];
|
||||||
|
|
||||||
setTimeout(function() {
|
// request current Servos Config
|
||||||
|
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT, false, function() {
|
||||||
|
send_message(MSP_codes.MSP_SERVO_CONF, MSP_codes.MSP_SERVO_CONF, false, function() {
|
||||||
|
// drop previous table
|
||||||
|
$('div.tab-servos table.fields tr:not(:first)').remove();
|
||||||
|
|
||||||
switch (CONFIG.multiType) {
|
switch (CONFIG.multiType) {
|
||||||
case 1: // TRI
|
case 1: // TRI
|
||||||
model.html('TRI');
|
model.html('TRI');
|
||||||
|
@ -77,7 +78,8 @@ function tab_initialize_servos() {
|
||||||
default:
|
default:
|
||||||
model.html('Doesn\'t support servos');
|
model.html('Doesn\'t support servos');
|
||||||
}
|
}
|
||||||
}, 50);
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// UI hooks
|
// UI hooks
|
||||||
$('a.update').click(function() {
|
$('a.update').click(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue