mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +03:00
Merge pull request #1336 from mikeller/fix_reconnect_attempts
Removed non-working reconnect attempts.
This commit is contained in:
commit
8abfdb7424
3 changed files with 13 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue