esp32tool 1.4.1 → 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.
Binary file
package/css/style.css CHANGED
@@ -2269,3 +2269,466 @@ body.console-active .main {
2269
2269
  padding-top: 0 !important;
2270
2270
  overflow: hidden !important;
2271
2271
  }
2272
+
2273
+ /* ========== Hex Editor Container ========== */
2274
+ .hexeditor-container {
2275
+ position: fixed;
2276
+ top: 0;
2277
+ left: 0;
2278
+ right: 0;
2279
+ bottom: 0;
2280
+ z-index: 1001;
2281
+ background-color: #1c1c1c;
2282
+ display: flex;
2283
+ flex-direction: column;
2284
+ font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
2285
+ color: #ddd;
2286
+ }
2287
+
2288
+ .hexeditor-container.hidden {
2289
+ display: none;
2290
+ }
2291
+
2292
+ /* Hide header and commands when hex editor is active */
2293
+ body.hexeditor-active .header {
2294
+ display: none !important;
2295
+ }
2296
+ body.hexeditor-active #commands {
2297
+ display: none !important;
2298
+ }
2299
+ body.hexeditor-active #notSupported {
2300
+ display: none !important;
2301
+ }
2302
+ body.hexeditor-active .main {
2303
+ padding-top: 0 !important;
2304
+ overflow: hidden !important;
2305
+ }
2306
+
2307
+ /* Hex Editor Header / Toolbar */
2308
+ .hexeditor-toolbar {
2309
+ display: flex;
2310
+ align-items: center;
2311
+ gap: 8px;
2312
+ padding: 6px 12px;
2313
+ background-color: #2a2a2a;
2314
+ border-bottom: 1px solid #444;
2315
+ flex-wrap: wrap;
2316
+ min-height: 40px;
2317
+ }
2318
+
2319
+ .hexeditor-toolbar h3 {
2320
+ margin: 0;
2321
+ font-size: 14px;
2322
+ font-weight: 600;
2323
+ white-space: nowrap;
2324
+ }
2325
+
2326
+ .hexeditor-toolbar .spacer {
2327
+ flex: 1;
2328
+ }
2329
+
2330
+ .hexeditor-toolbar button {
2331
+ padding: 4px 14px;
2332
+ font-size: 12px;
2333
+ background-color: #444;
2334
+ color: #ddd;
2335
+ border: 1px solid #555;
2336
+ border-radius: 3px;
2337
+ cursor: pointer;
2338
+ white-space: nowrap;
2339
+ }
2340
+
2341
+ .hexeditor-toolbar button:hover {
2342
+ background-color: #555;
2343
+ }
2344
+
2345
+ .hexeditor-toolbar button.primary {
2346
+ background-color: #2e7d32;
2347
+ border-color: #388e3c;
2348
+ }
2349
+
2350
+ .hexeditor-toolbar button.primary:hover {
2351
+ background-color: #388e3c;
2352
+ }
2353
+
2354
+ .hexeditor-toolbar button.danger {
2355
+ background-color: #c62828;
2356
+ border-color: #d32f2f;
2357
+ }
2358
+
2359
+ .hexeditor-toolbar button.danger:hover {
2360
+ background-color: #d32f2f;
2361
+ }
2362
+
2363
+ .hexeditor-toolbar button:disabled {
2364
+ opacity: 0.5;
2365
+ cursor: not-allowed;
2366
+ }
2367
+
2368
+ /* Search bar */
2369
+ .hexeditor-search {
2370
+ display: flex;
2371
+ align-items: center;
2372
+ gap: 6px;
2373
+ padding: 4px 12px;
2374
+ background-color: #252525;
2375
+ border-bottom: 1px solid #333;
2376
+ }
2377
+
2378
+ .hexeditor-search label {
2379
+ font-size: 12px;
2380
+ color: #aaa;
2381
+ white-space: nowrap;
2382
+ }
2383
+
2384
+ .hexeditor-search input[type="text"] {
2385
+ padding: 3px 8px;
2386
+ font-size: 12px;
2387
+ font-family: inherit;
2388
+ background-color: #333;
2389
+ color: #ddd;
2390
+ border: 1px solid #555;
2391
+ border-radius: 3px;
2392
+ outline: none;
2393
+ width: 200px;
2394
+ }
2395
+
2396
+ .hexeditor-search input[type="text"]:focus {
2397
+ border-color: #71ae1e;
2398
+ }
2399
+
2400
+ .hexeditor-search select {
2401
+ padding: 3px 6px;
2402
+ font-size: 12px;
2403
+ font-family: inherit;
2404
+ background-color: #333;
2405
+ color: #ddd;
2406
+ border: 1px solid #555;
2407
+ border-radius: 3px;
2408
+ outline: none;
2409
+ }
2410
+
2411
+ .hexeditor-search button {
2412
+ padding: 3px 10px;
2413
+ font-size: 12px;
2414
+ background-color: #444;
2415
+ color: #ddd;
2416
+ border: 1px solid #555;
2417
+ border-radius: 3px;
2418
+ cursor: pointer;
2419
+ }
2420
+
2421
+ .hexeditor-search button:hover {
2422
+ background-color: #555;
2423
+ }
2424
+
2425
+ .hexeditor-search .search-info {
2426
+ font-size: 11px;
2427
+ color: #888;
2428
+ margin-left: 4px;
2429
+ }
2430
+
2431
+ /* Status bar */
2432
+ .hexeditor-statusbar {
2433
+ display: flex;
2434
+ align-items: center;
2435
+ gap: 16px;
2436
+ padding: 4px 12px;
2437
+ background-color: #1a3a1a;
2438
+ border-top: 1px solid #444;
2439
+ font-size: 11px;
2440
+ color: #aaa;
2441
+ }
2442
+
2443
+ .hexeditor-statusbar .status-item {
2444
+ white-space: nowrap;
2445
+ }
2446
+
2447
+ .hexeditor-statusbar .status-modified {
2448
+ color: #ffab40;
2449
+ font-weight: 600;
2450
+ }
2451
+
2452
+ /* Main hex content area */
2453
+ .hexeditor-body {
2454
+ flex: 1;
2455
+ overflow: hidden;
2456
+ display: flex;
2457
+ flex-direction: column;
2458
+ position: relative;
2459
+ }
2460
+
2461
+ .hexeditor-viewport {
2462
+ flex: 1;
2463
+ overflow-y: auto;
2464
+ overflow-x: auto;
2465
+ position: relative;
2466
+ }
2467
+
2468
+ /* Row layout */
2469
+ .hexeditor-row {
2470
+ display: flex;
2471
+ line-height: 20px;
2472
+ height: 20px;
2473
+ white-space: nowrap;
2474
+ }
2475
+
2476
+ .hexeditor-row:hover {
2477
+ background-color: #2a2a2a;
2478
+ }
2479
+
2480
+ .hexeditor-row.highlight-row {
2481
+ background-color: #3a3a1a !important;
2482
+ }
2483
+
2484
+ /* Address gutter */
2485
+ .hexeditor-addr {
2486
+ width: 80px;
2487
+ min-width: 80px;
2488
+ text-align: right;
2489
+ padding-right: 12px;
2490
+ color: #6a9955;
2491
+ font-size: 12px;
2492
+ user-select: none;
2493
+ -webkit-user-select: none;
2494
+ }
2495
+
2496
+ /* Hex cells area */
2497
+ .hexeditor-hex {
2498
+ display: flex;
2499
+ gap: 0;
2500
+ padding-right: 16px;
2501
+ }
2502
+
2503
+ .hexeditor-hex .hex-cell {
2504
+ width: 26px;
2505
+ text-align: center;
2506
+ font-size: 12px;
2507
+ cursor: text;
2508
+ color: #ddd;
2509
+ border: 1px solid transparent;
2510
+ padding: 0 1px;
2511
+ box-sizing: border-box;
2512
+ }
2513
+
2514
+ .hexeditor-hex .hex-cell:nth-child(8n) {
2515
+ margin-right: 6px;
2516
+ }
2517
+
2518
+ .hexeditor-hex .hex-cell.modified {
2519
+ color: #ff6b6b;
2520
+ font-weight: bold;
2521
+ }
2522
+
2523
+ .hexeditor-hex .hex-cell.selected {
2524
+ background-color: #264f78;
2525
+ border-color: #3a7cbf;
2526
+ }
2527
+
2528
+ .hexeditor-hex .hex-cell.search-match {
2529
+ background-color: #5a5a00;
2530
+ border-color: #8a8a00;
2531
+ }
2532
+
2533
+ .hexeditor-hex .hex-cell.search-current {
2534
+ background-color: #8a6a00;
2535
+ border-color: #bb9b00;
2536
+ }
2537
+
2538
+ .hexeditor-hex .hex-cell.editing {
2539
+ background-color: #1e3a5f;
2540
+ border-color: #4a90d9;
2541
+ outline: none;
2542
+ }
2543
+
2544
+ .hexeditor-hex .hex-cell.zero {
2545
+ color: #555;
2546
+ }
2547
+
2548
+ .hexeditor-hex .hex-cell.ff {
2549
+ color: #666;
2550
+ }
2551
+
2552
+ /* Separator between hex and ASCII */
2553
+ .hexeditor-sep {
2554
+ width: 2px;
2555
+ min-width: 2px;
2556
+ background-color: #444;
2557
+ margin: 0 4px;
2558
+ }
2559
+
2560
+ /* ASCII area */
2561
+ .hexeditor-ascii {
2562
+ display: flex;
2563
+ gap: 0;
2564
+ }
2565
+
2566
+ .hexeditor-ascii .ascii-cell {
2567
+ width: 9px;
2568
+ text-align: center;
2569
+ font-size: 12px;
2570
+ cursor: text;
2571
+ color: #b5cea8;
2572
+ border: 1px solid transparent;
2573
+ box-sizing: border-box;
2574
+ }
2575
+
2576
+ .hexeditor-ascii .ascii-cell.non-printable {
2577
+ color: #555;
2578
+ }
2579
+
2580
+ .hexeditor-ascii .ascii-cell.modified {
2581
+ color: #ff6b6b;
2582
+ font-weight: bold;
2583
+ }
2584
+
2585
+ .hexeditor-ascii .ascii-cell.selected {
2586
+ background-color: #264f78;
2587
+ border-color: #3a7cbf;
2588
+ }
2589
+
2590
+ .hexeditor-ascii .ascii-cell.search-match {
2591
+ background-color: #5a5a00;
2592
+ border-color: #8a8a00;
2593
+ }
2594
+
2595
+ .hexeditor-ascii .ascii-cell.search-current {
2596
+ background-color: #8a6a00;
2597
+ border-color: #bb9b00;
2598
+ }
2599
+
2600
+ .hexeditor-ascii .ascii-cell.editing {
2601
+ background-color: #1e3a5f;
2602
+ border-color: #4a90d9;
2603
+ outline: none;
2604
+ }
2605
+
2606
+ /* Progress overlay for loading */
2607
+ .hexeditor-progress-overlay {
2608
+ position: absolute;
2609
+ top: 0; left: 0; right: 0; bottom: 0;
2610
+ background-color: rgba(0,0,0,0.85);
2611
+ display: flex;
2612
+ flex-direction: column;
2613
+ align-items: center;
2614
+ justify-content: center;
2615
+ z-index: 10;
2616
+ }
2617
+
2618
+ .hexeditor-progress-overlay.hidden {
2619
+ display: none;
2620
+ }
2621
+
2622
+ .hexeditor-progress-overlay .progress-text {
2623
+ font-size: 16px;
2624
+ color: #ddd;
2625
+ margin-bottom: 16px;
2626
+ }
2627
+
2628
+ .hexeditor-progress-overlay .progress-bar-outer {
2629
+ width: 400px;
2630
+ max-width: 80%;
2631
+ height: 20px;
2632
+ background-color: #333;
2633
+ border-radius: 10px;
2634
+ overflow: hidden;
2635
+ }
2636
+
2637
+ .hexeditor-progress-overlay .progress-bar-inner {
2638
+ height: 100%;
2639
+ background-color: #71ae1e;
2640
+ width: 0%;
2641
+ transition: width 0.15s linear;
2642
+ border-radius: 10px;
2643
+ }
2644
+
2645
+ /* Goto address input */
2646
+ .hexeditor-goto {
2647
+ display: flex;
2648
+ align-items: center;
2649
+ gap: 6px;
2650
+ }
2651
+
2652
+ .hexeditor-goto input {
2653
+ width: 100px;
2654
+ padding: 3px 8px;
2655
+ font-size: 12px;
2656
+ font-family: inherit;
2657
+ background-color: #333;
2658
+ color: #ddd;
2659
+ border: 1px solid #555;
2660
+ border-radius: 3px;
2661
+ outline: none;
2662
+ }
2663
+
2664
+ .hexeditor-goto input:focus {
2665
+ border-color: #71ae1e;
2666
+ }
2667
+
2668
+ /* Responsive hex editor for narrow viewports */
2669
+ @media (max-width: 768px) {
2670
+ .hexeditor-container {
2671
+ font-size: 11px;
2672
+ }
2673
+
2674
+ .hexeditor-toolbar {
2675
+ padding: 4px 8px;
2676
+ gap: 4px;
2677
+ }
2678
+
2679
+ .hexeditor-toolbar h3 {
2680
+ font-size: 12px;
2681
+ }
2682
+
2683
+ .hexeditor-toolbar button {
2684
+ padding: 3px 8px;
2685
+ font-size: 11px;
2686
+ }
2687
+
2688
+ .hexeditor-search {
2689
+ flex-wrap: wrap;
2690
+ gap: 4px;
2691
+ padding: 4px 8px;
2692
+ }
2693
+
2694
+ .hexeditor-search input[type="text"] {
2695
+ width: 140px;
2696
+ font-size: 11px;
2697
+ }
2698
+
2699
+ .hexeditor-addr {
2700
+ width: 64px;
2701
+ min-width: 64px;
2702
+ padding-right: 6px;
2703
+ font-size: 11px;
2704
+ }
2705
+
2706
+ .hexeditor-hex .hex-cell {
2707
+ width: 20px;
2708
+ font-size: 11px;
2709
+ }
2710
+
2711
+ .hexeditor-hex .hex-cell:nth-child(8n) {
2712
+ margin-right: 3px;
2713
+ }
2714
+
2715
+ .hexeditor-ascii .ascii-cell {
2716
+ width: 7px;
2717
+ font-size: 11px;
2718
+ }
2719
+
2720
+ .hexeditor-sep {
2721
+ margin: 0 2px;
2722
+ }
2723
+
2724
+ .hexeditor-statusbar {
2725
+ gap: 8px;
2726
+ padding: 3px 8px;
2727
+ font-size: 10px;
2728
+ flex-wrap: wrap;
2729
+ }
2730
+
2731
+ .hexeditor-goto input {
2732
+ width: 70px;
2733
+ }
2734
+ }
package/dist/cli.js CHANGED
@@ -218,7 +218,7 @@ async function connectViaUSB(targetVid, targetPid, baudRate) {
218
218
  try {
219
219
  await webPort.close();
220
220
  }
221
- catch (closeErr) {
221
+ catch (_closeErr) {
222
222
  // Ignore close errors
223
223
  }
224
224
  }
@@ -427,7 +427,7 @@ async function main() {
427
427
  try {
428
428
  await esploader.disconnect();
429
429
  }
430
- catch (disconnectErr) {
430
+ catch (_disconnectErr) {
431
431
  // Ignore disconnect errors during error handling
432
432
  }
433
433
  }
@@ -714,14 +714,20 @@ export class ESPLoader extends EventTarget {
714
714
  }
715
715
  else {
716
716
  if (step.dtr !== undefined) {
717
- webusb
718
- ? await this.setDTRWebUSB(step.dtr)
719
- : await this.setDTR(step.dtr);
717
+ if (webusb) {
718
+ await this.setDTRWebUSB(step.dtr);
719
+ }
720
+ else {
721
+ await this.setDTR(step.dtr);
722
+ }
720
723
  }
721
724
  if (step.rts !== undefined) {
722
- webusb
723
- ? await this.setRTSWebUSB(step.rts)
724
- : await this.setRTS(step.rts);
725
+ if (webusb) {
726
+ await this.setRTSWebUSB(step.rts);
727
+ }
728
+ else {
729
+ await this.setRTS(step.rts);
730
+ }
725
731
  }
726
732
  }
727
733
  if (step.delayMs)
@@ -1193,7 +1199,7 @@ export class ESPLoader extends EventTarget {
1193
1199
  this.logger.debug(`Connected CDC/JTAG successfully with ${strategy.name} reset.`);
1194
1200
  return;
1195
1201
  }
1196
- catch (error) {
1202
+ catch (_error) {
1197
1203
  throw new Error("Sync timeout or abandoned");
1198
1204
  }
1199
1205
  }
@@ -1995,7 +2001,7 @@ export class ESPLoader extends EventTarget {
1995
2001
  // Restart Readloop
1996
2002
  this.readLoop();
1997
2003
  }
1998
- catch (e) {
2004
+ catch (_e) {
1999
2005
  // this.logger.error(`Reconfigure port error: ${e}`);
2000
2006
  // throw new Error(`Unable to change the baud rate to ${baud}: ${e}`);
2001
2007
  }
@@ -2602,7 +2608,7 @@ export class ESPLoader extends EventTarget {
2602
2608
  try {
2603
2609
  await this._writeChain;
2604
2610
  }
2605
- catch (err) {
2611
+ catch (_err) {
2606
2612
  // this.logger.debug(`Pending write error during disconnect: ${err}`);
2607
2613
  }
2608
2614
  // Release persistent writer before closing
@@ -2611,7 +2617,7 @@ export class ESPLoader extends EventTarget {
2611
2617
  await this._writer.close();
2612
2618
  this._writer.releaseLock();
2613
2619
  }
2614
- catch (err) {
2620
+ catch (_err) {
2615
2621
  // this.logger.debug(`Writer close/release error: ${err}`);
2616
2622
  }
2617
2623
  this._writer = undefined;
@@ -2624,7 +2630,7 @@ export class ESPLoader extends EventTarget {
2624
2630
  await writer.close();
2625
2631
  writer.releaseLock();
2626
2632
  }
2627
- catch (err) {
2633
+ catch (_err) {
2628
2634
  // this.logger.debug(`Direct writer close error: ${err}`);
2629
2635
  }
2630
2636
  }
@@ -2646,7 +2652,7 @@ export class ESPLoader extends EventTarget {
2646
2652
  try {
2647
2653
  this._reader.cancel();
2648
2654
  }
2649
- catch (err) {
2655
+ catch (_err) {
2650
2656
  // Reader already released, resolve immediately
2651
2657
  clearTimeout(timeout);
2652
2658
  resolve(undefined);
@@ -2676,7 +2682,7 @@ export class ESPLoader extends EventTarget {
2676
2682
  try {
2677
2683
  await this._writeChain;
2678
2684
  }
2679
- catch (err) {
2685
+ catch (_err) {
2680
2686
  // this.logger.debug(`Pending write error during release: ${err}`);
2681
2687
  }
2682
2688
  // Release writer
@@ -47,7 +47,7 @@ export function createNodeUSBAdapter(device, logger) {
47
47
  device.setConfiguration(1);
48
48
  }
49
49
  }
50
- catch (err) {
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 (err) {
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, reject) => {
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, reject) => {
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 (err) {
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 (err) {
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 (err) {
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 (err) {
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 (err) {
193
+ catch (_err) {
194
194
  // Ignore
195
195
  }
196
196
  }
197
197
  try {
198
198
  device.close();
199
199
  }
200
- catch (err) {
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 (e) {
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 (err) {
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 (err) {
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/eslint.config.js CHANGED
@@ -14,6 +14,15 @@ export default tseslint.config(
14
14
  rules: {
15
15
  "no-console": "warn",
16
16
  "prettier/prettier": "error",
17
+ "@typescript-eslint/no-unused-vars": [
18
+ "error",
19
+ {
20
+ argsIgnorePattern: "^_",
21
+ varsIgnorePattern: "^_",
22
+ caughtErrorsIgnorePattern: "^_",
23
+ },
24
+ ],
25
+ "@typescript-eslint/no-explicit-any": "off",
17
26
  },
18
27
  },
19
28
  {
Binary file
Binary file
Binary file