Skip to content

Commit

Permalink
Bump esptool-js to 0.3.0 (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Jul 8, 2023
1 parent 1e4cd0d commit 2f736cb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@material/mwc-formfield": "^0.27.0",
"@material/mwc-icon-button": "^0.27.0",
"@material/mwc-textfield": "^0.27.0",
"esptool-js": "^0.2.2",
"esptool-js": "^0.3.0",
"improv-wifi-serial-sdk": "^2.5.0",
"lit": "^2.7.5",
"pako": "^2.1.0",
Expand Down
24 changes: 14 additions & 10 deletions src/flash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export const flash = async (
});

const transport = new Transport(port);
const esploader = new ESPLoader(transport, 115200, undefined);
const esploader = new ESPLoader({
transport,
baudrate: 115200,
romBaudrate: 115200,
});

// For debugging
(window as any).esploader = esploader;
Expand Down Expand Up @@ -181,15 +185,15 @@ export const flash = async (
let totalWritten = 0;

try {
await esploader.write_flash(
await esploader.write_flash({
fileArray,
"keep",
"keep",
"keep",
false,
true,
flashSize: "keep",
flashMode: "keep",
flashFreq: "keep",
eraseAll: false,
compress: true,
// report progress
(fileIndex: number, written: number, total: number) => {
reportProgress: (fileIndex: number, written: number, total: number) => {
const uncompressedWritten =
(written / total) * fileArray[fileIndex].data.length;

Expand All @@ -212,8 +216,8 @@ export const flash = async (
percentage: newPct,
},
});
}
);
},
});
} catch (err: any) {
fireStateEvent({
state: FlashStateType.ERROR,
Expand Down

0 comments on commit 2f736cb

Please sign in to comment.