mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-21 07:15:15 +03:00
parent
75aa30a562
commit
c842b9d60b
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,7 @@ let liveDataRefreshTimerId = false;
|
|||
let isConnected = false;
|
||||
|
||||
const REBOOT_CONNECT_MAX_TIME_MS = 10000;
|
||||
const REBOOT_GRACE_PERIOD_MS = 2000;
|
||||
let rebootTimestamp = 0;
|
||||
|
||||
const toggleStatus = function () {
|
||||
|
@ -109,6 +110,12 @@ function connectDisconnect() {
|
|||
return;
|
||||
}
|
||||
|
||||
// When rebooting, adhere to the auto-connect setting
|
||||
if (!PortHandler.portPicker.autoConnect && Date.now() - rebootTimestamp < REBOOT_GRACE_PERIOD_MS) {
|
||||
console.log(`${logHead} Rebooting, not connecting`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`${logHead} Connecting to: ${portName}`);
|
||||
GUI.connecting_to = portName;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue