Removed non-working reconnect attempts.
parent
2286b9dfa4
commit
80220738d1
|
@ -4639,7 +4639,7 @@
|
|||
"semver": "^5.5.0",
|
||||
"simple-glob": "~0.2.0",
|
||||
"tar-fs": "^1.13.0",
|
||||
"temp": "github:adam-lynch/node-temp#279c1350cb7e4f02515d91da9e35d39a40774016",
|
||||
"temp": "github:adam-lynch/node-temp#remove_tmpdir_dep",
|
||||
"thenify": "^3.3.0",
|
||||
"update-notifier": "^2.4.0",
|
||||
"winresourcer": "^0.9.0"
|
||||
|
|
|
@ -729,14 +729,19 @@ function reinitialiseConnection(originatorTab, callback) {
|
|||
GUI.log(i18n.getMessage('deviceRebooting'));
|
||||
|
||||
if (FC.boardHasVcp()) { // VCP-based flight controls may crash old drivers, we catch and reconnect
|
||||
setTimeout(function start_connection() {
|
||||
$('a.connect').click();
|
||||
GUI.timeout_add('waiting_for_disconnect', function waiting_for_bootup() {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}, 2500);
|
||||
}, 100);
|
||||
//TODO: Need to work out how to do a proper reconnect here.
|
||||
// caveat: Timeouts set with `GUI.timeout_add()` are removed on disconnect.
|
||||
} else {
|
||||
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
|
||||
GUI.log(i18n.getMessage('deviceReady'));
|
||||
originatorTab.initialize(false, $('#content').scrollTop());
|
||||
|
|
|
@ -398,9 +398,10 @@ TABS.cli.cleanup = function (callback) {
|
|||
// (another approach is however much more complicated):
|
||||
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
|
||||
// we could probably implement this someday
|
||||
reinitialiseConnection(self, function () {
|
||||
GUI.timeout_add('tab_change_callback', callback, 500);
|
||||
});
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
CONFIGURATOR.cliActive = false;
|
||||
CONFIGURATOR.cliValid = false;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue