esp32tool 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple-touch-icon.png +0 -0
- package/css/style.css +463 -0
- package/dist/cli.js +2 -2
- package/dist/esp_loader.js +29 -17
- package/dist/node-usb-adapter.js +13 -13
- package/dist/util/console-color.js +1 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.js +15 -0
- package/dist/web/index.js +1 -1
- package/eslint.config.js +9 -0
- package/icons/icon-128.png +0 -0
- package/icons/icon-144.png +0 -0
- package/icons/icon-152.png +0 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-384.png +0 -0
- package/icons/icon-512.png +0 -0
- package/icons/icon-72.png +0 -0
- package/icons/icon-96.png +0 -0
- package/index.html +5 -0
- package/js/hex-editor.js +833 -0
- package/js/modules/esptool.js +1 -1
- package/js/script.js +164 -24
- package/package.json +7 -7
- package/screenshots/desktop.png +0 -0
- package/screenshots/mobile.png +0 -0
- package/src/cli.ts +2 -2
- package/src/const.ts +0 -2
- package/src/esp_loader.ts +30 -17
- package/src/node-usb-adapter.ts +13 -13
- package/src/util/console-color.ts +1 -0
- package/src/util.ts +20 -0
- package/sw.js +2 -1
package/dist/node-usb-adapter.js
CHANGED
|
@@ -47,7 +47,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
47
47
|
device.setConfiguration(1);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
catch (
|
|
50
|
+
catch (_err) {
|
|
51
51
|
// Already configured
|
|
52
52
|
}
|
|
53
53
|
// Find bulk IN/OUT interface
|
|
@@ -99,7 +99,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
99
99
|
usbInterface.detachKernelDriver();
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
catch (
|
|
102
|
+
catch (_err) {
|
|
103
103
|
// Ignore - may not be supported on all platforms
|
|
104
104
|
}
|
|
105
105
|
usbInterface.claim();
|
|
@@ -126,7 +126,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
126
126
|
if (vendorId === 0x10c4) {
|
|
127
127
|
try {
|
|
128
128
|
// Clear halt on endpoints
|
|
129
|
-
await new Promise((resolve,
|
|
129
|
+
await new Promise((resolve, _reject) => {
|
|
130
130
|
device.controlTransfer(0x02, // Clear Feature, Endpoint
|
|
131
131
|
0x01, // ENDPOINT_HALT
|
|
132
132
|
0, endpointIn.address, Buffer.alloc(0), (err) => {
|
|
@@ -135,7 +135,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
135
135
|
resolve();
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
|
-
await new Promise((resolve,
|
|
138
|
+
await new Promise((resolve, _reject) => {
|
|
139
139
|
device.controlTransfer(0x02, // Clear Feature, Endpoint
|
|
140
140
|
0x01, // ENDPOINT_HALT
|
|
141
141
|
0, endpointOut.address, Buffer.alloc(0), (err) => {
|
|
@@ -145,7 +145,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
catch (
|
|
148
|
+
catch (_err) {
|
|
149
149
|
// Ignore
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -161,7 +161,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
161
161
|
endpointIn.stopPoll();
|
|
162
162
|
endpointIn.removeAllListeners();
|
|
163
163
|
}
|
|
164
|
-
catch (
|
|
164
|
+
catch (_err) {
|
|
165
165
|
// Ignore
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -169,7 +169,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
169
169
|
try {
|
|
170
170
|
await readableStream.cancel();
|
|
171
171
|
}
|
|
172
|
-
catch (
|
|
172
|
+
catch (_err) {
|
|
173
173
|
// Ignore
|
|
174
174
|
}
|
|
175
175
|
readableStream = null;
|
|
@@ -178,7 +178,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
178
178
|
try {
|
|
179
179
|
await writableStream.close();
|
|
180
180
|
}
|
|
181
|
-
catch (
|
|
181
|
+
catch (_err) {
|
|
182
182
|
// Ignore
|
|
183
183
|
}
|
|
184
184
|
writableStream = null;
|
|
@@ -190,14 +190,14 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
190
190
|
const usbInterface = device.interface(interfaceNumber);
|
|
191
191
|
usbInterface.release(true, () => { });
|
|
192
192
|
}
|
|
193
|
-
catch (
|
|
193
|
+
catch (_err) {
|
|
194
194
|
// Ignore
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
try {
|
|
198
198
|
device.close();
|
|
199
199
|
}
|
|
200
|
-
catch (
|
|
200
|
+
catch (_err) {
|
|
201
201
|
// Ignore
|
|
202
202
|
}
|
|
203
203
|
},
|
|
@@ -370,7 +370,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
370
370
|
logger.error(`USB read error: ${err.message}`);
|
|
371
371
|
// Don't close on error, just log it
|
|
372
372
|
}
|
|
373
|
-
catch (
|
|
373
|
+
catch (_e) {
|
|
374
374
|
// Ignore errors in error handler
|
|
375
375
|
}
|
|
376
376
|
});
|
|
@@ -378,7 +378,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
378
378
|
try {
|
|
379
379
|
controller.close();
|
|
380
380
|
}
|
|
381
|
-
catch (
|
|
381
|
+
catch (_err) {
|
|
382
382
|
// Ignore errors when closing controller
|
|
383
383
|
}
|
|
384
384
|
});
|
|
@@ -389,7 +389,7 @@ export function createNodeUSBAdapter(device, logger) {
|
|
|
389
389
|
endpointIn.stopPoll();
|
|
390
390
|
endpointIn.removeAllListeners();
|
|
391
391
|
}
|
|
392
|
-
catch (
|
|
392
|
+
catch (_err) {
|
|
393
393
|
// Ignore
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -17,6 +17,7 @@ export class ColoredConsole {
|
|
|
17
17
|
}
|
|
18
18
|
addLine(line) {
|
|
19
19
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape sequences
|
|
20
|
+
// eslint-disable-next-line no-control-regex
|
|
20
21
|
const re = /(?:\x1B|\\x1B)(?:\[(.*?)[@-~]|\].*?(?:\x07|\x1B\\))/g;
|
|
21
22
|
let i = 0;
|
|
22
23
|
if (this.state.carriageReturn) {
|
package/dist/util.d.ts
CHANGED
|
@@ -15,4 +15,9 @@ export declare const toHex: (value: number, size?: number) => string;
|
|
|
15
15
|
* Format MAC address array to string (e.g., [0xAA, 0xBB, 0xCC] -> "AA:BB:CC:DD:EE:FF")
|
|
16
16
|
*/
|
|
17
17
|
export declare const formatMacAddr: (macAddr: number[]) => string;
|
|
18
|
+
/**
|
|
19
|
+
* @name padTo
|
|
20
|
+
* Pad data to the next alignment boundary with the given fill byte (default 0xFF)
|
|
21
|
+
*/
|
|
22
|
+
export declare function padTo(data: Uint8Array, alignment: number, padCharacter?: number): Uint8Array;
|
|
18
23
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
package/dist/util.js
CHANGED
|
@@ -51,4 +51,19 @@ export const formatMacAddr = (macAddr) => {
|
|
|
51
51
|
.map((value) => value.toString(16).toUpperCase().padStart(2, "0"))
|
|
52
52
|
.join(":");
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* @name padTo
|
|
56
|
+
* Pad data to the next alignment boundary with the given fill byte (default 0xFF)
|
|
57
|
+
*/
|
|
58
|
+
export function padTo(data, alignment, padCharacter = 0xff) {
|
|
59
|
+
const padMod = data.length % alignment;
|
|
60
|
+
if (padMod !== 0) {
|
|
61
|
+
const padding = new Uint8Array(alignment - padMod).fill(padCharacter);
|
|
62
|
+
const paddedData = new Uint8Array(data.length + padding.length);
|
|
63
|
+
paddedData.set(data);
|
|
64
|
+
paddedData.set(padding, data.length);
|
|
65
|
+
return paddedData;
|
|
66
|
+
}
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
54
69
|
export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|