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

Added auto-detection of VCP targets. Also added re-connecting after reboot for VCP targets.

This commit is contained in:
mikeller 2019-02-13 01:34:30 +13:00
parent c30c2142b1
commit 1530bed5b6
8 changed files with 71 additions and 135 deletions

View file

@ -304,7 +304,8 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
GUI.log(i18n.getMessage('transponderEepromSaved'));
if ( $(_this).hasClass('reboot') ) {
GUI.tab_switch_cleanup(function() {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, reinitialize);
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false);
reinitialiseConnection(self);
});
}
});
@ -320,23 +321,6 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
});
}
function reinitialize() {
GUI.log(i18n.getMessage('deviceRebooting'));
if ( BOARD.find_board_definition(CONFIG.boardIdentifier).vcp ) {
$('a.connect').click();
GUI.timeout_add('start_connection', function start_connection() {
$('a.connect').click();
}, 2500);
} else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, function() {
GUI.log(i18n.getMessage('deviceReady'));
TABS.configuration.initialize(false, $('#content').scrollTop());
});
}, 1500);
}
}
GUI.content_ready(callback);
}
};