diff --git a/js/esptool.js b/js/esptool.js index 154ab46..ee93cea 100755 --- a/js/esptool.js +++ b/js/esptool.js @@ -379,28 +379,27 @@ class EspLoader { */ async connect(bypassRequest = false) { if (!bypassRequest) { - // - Request a port and open a connection. - const filter = { usbVendorId: 0x10c4 }; - var filters = [] - if (!this.debug) { - filters.push(filter); - } - port = await navigator.serial.requestPort({ filters: filters }); - - // - Wait for the port to open.toggleUIConnected - if (this.getChromeVersion() < 86) { - await port.open({ baudrate: ESP_ROM_BAUD }); - } else { - await port.open({ baudRate: ESP_ROM_BAUD }); + const filter = { usbVendorId: 0x10c4 }; + var filters = [] + if (!this.debug) { + filters.push(filter); + } + port = await navigator.serial.requestPort({ filters: filters }); + if (this.getChromeVersion() < 86) { + await port.open({ baudrate: ESP_ROM_BAUD }); + } else { + await port.open({ baudRate: ESP_ROM_BAUD }); } } const signals = await port.getSignals(); - this.logMsg("Connected successfully.") + this.logMsg("Serial connection opened successfully.") - this.logMsg("Try to reset.") - await this.hardReset(true); + if(!bypassRequest){ + this.logMsg("Try to reset.") + await this.hardReset(true); + } outputStream = port.writable; inputStream = port.readable;