mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-18 22:05:13 +03:00
Added auto-detection of VCP targets. Also added re-connecting after reboot for VCP targets.
This commit is contained in:
parent
c30c2142b1
commit
1530bed5b6
8 changed files with 71 additions and 135 deletions
|
@ -724,3 +724,23 @@ function update_dataflash_global() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}, 2500);
|
||||
} else {
|
||||
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
|
||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
|
||||
GUI.log(i18n.getMessage('deviceReady'));
|
||||
originatorTab.initialize(false, $('#content').scrollTop());
|
||||
});
|
||||
}, 1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue