Skip to content

Commit

Permalink
add things
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceywasabi committed Sep 22, 2024
1 parent bd53b6e commit fa5b4e6
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions js/esptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa5b4e6

Please sign in to comment.