mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Fix noselection and not closing dfu after flashing (#3993)
* Fix noselection * Move select#baud element to vue * Keep focus * Do not automatically connect after flashing * Proper select DFU * Proper select DFU v2 * Proper select DFU v3 * Fix parentheses * Duh * Finally * Cleanup
This commit is contained in:
parent
3980cdc307
commit
2f87ab29f7
3 changed files with 7 additions and 9 deletions
|
@ -67,7 +67,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="value.selectedPort !== 'virtual'"
|
||||
v-if="value.selectedPort !== 'virtual' && value.selectedPort !== 'noselection'"
|
||||
id="baudselect"
|
||||
>
|
||||
<div class="dropdown dropdown-dark">
|
||||
|
|
|
@ -202,10 +202,13 @@ class WEBUSBDFU_protocol extends EventTarget {
|
|||
this.usbDevice
|
||||
.releaseInterface(interfaceNumber, () => {
|
||||
console.log(`Released interface: ${interfaceNumber}`);
|
||||
this.closeDevice();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(`Could not release interface: ${interfaceNumber} (${error})`);
|
||||
})
|
||||
.finally(() => {
|
||||
// releaseInterface does not work on some devices, so we close the device anyways
|
||||
this.closeDevice();
|
||||
});
|
||||
}
|
||||
resetDevice(callback) {
|
||||
|
|
|
@ -57,7 +57,7 @@ export function initializeSerialBackend() {
|
|||
$("div.connect_controls a.connect").on('click', connectDisconnect);
|
||||
|
||||
EventBus.$on('port-handler:auto-select-serial-device', function(device) {
|
||||
if (!GUI.connected_to && !GUI.connecting_to
|
||||
if (!GUI.connected_to && !GUI.connecting_to && GUI.active_tab !== 'firmware_flasher'
|
||||
&& ((PortHandler.portPicker.autoConnect && !["manual", "virtual"].includes(device))
|
||||
|| Date.now() - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS)) {
|
||||
connectDisconnect();
|
||||
|
@ -95,7 +95,7 @@ function connectDisconnect() {
|
|||
portName = selectedPort;
|
||||
}
|
||||
|
||||
if (!GUI.connect_lock && selectedPort !== 'none') {
|
||||
if (!GUI.connect_lock && selectedPort !== 'noselection' && !selectedPort.path?.startsWith('usb_')) {
|
||||
// GUI control overrides the user control
|
||||
|
||||
GUI.configuration_loaded = false;
|
||||
|
@ -103,11 +103,6 @@ function connectDisconnect() {
|
|||
const selected_baud = PortHandler.portPicker.selectedBauds;
|
||||
const selectedPort = portName;
|
||||
|
||||
if (selectedPort === 'DFU') {
|
||||
$('select#baud').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isConnected) {
|
||||
console.log(`Connecting to: ${portName}`);
|
||||
GUI.connecting_to = portName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue