Skip to content

Commit

Permalink
Add req timings
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceywasabi committed Sep 25, 2024
1 parent 49baeb8 commit 0306bb7
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion js/esptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class EspLoader {

if(!bypassRequest){
this.logMsg("Try to reset.")
await this.hardReset(true);
await this.preferredReset(true);
}

outputStream = port.writable;
Expand Down Expand Up @@ -915,6 +915,22 @@ class EspLoader {
await new Promise((resolve) => setTimeout(resolve, 500));
}

async preferredReset(r = false) {
logMsg("Power Off...")
await port.setSignals({
dataTerminalReady: false,
requestToSend: true,
});
await new Promise((resolve) => setTimeout(resolve, 2000));
await port.setSignals({
dataTerminalReady: r,
requestToSend: false,
//break: false,
});
await new Promise((resolve) => setTimeout(resolve, 1000))
}


async getStubCode() {
let response = await fetch('stubs/' + this.getStubFile() + '.json');
let stubcode = await response.json();
Expand Down

0 comments on commit 0306bb7

Please sign in to comment.