1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

fixed reboot sequence

This commit is contained in:
Pawel Spychalski (DzikuVx) 2016-12-23 16:08:42 +01:00
parent 6581da1654
commit 9de6e9d2f1
9 changed files with 91 additions and 106 deletions

View file

@ -7,6 +7,45 @@ $(document).ready(function () {
$baud = $('#baud'),
$portOverride = $('#port-override');
GUI.handleReconnect = function ($tabElement) {
if (BOARD.find_board_definition(CONFIG.boardIdentifier).vcp) { // VCP-based flight controls may crash old drivers, we catch and reconnect
/*
Disconnect
*/
setTimeout(function () {
$('a.connect').click();
}, 100);
/*
Connect again
*/
setTimeout(function start_connection() {
$('a.connect').click();
/*
Open configuration tab
*/
if ($tabElement != null) {
setTimeout(function () {
$tabElement.click();
}, 250);
}
}, 5000);
} else {
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSPCodes.MSP_IDENT, false, false, function () {
//noinspection JSUnresolvedVariable
GUI.log(chrome.i18n.getMessage('deviceReady'));
//noinspection JSValidateTypes
TABS.configuration.initialize(false, $('#content').scrollTop());
});
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
}
};
GUI.updateManualPortVisibility = function(){
var selected_port = $port.find('option:selected');
if (selected_port.data().isManual) {
@ -148,9 +187,6 @@ $(document).ready(function () {
PortUsage.initialize();
});
function onOpen(openInfo) {
if (openInfo) {
// update connected_to