Make chip type probing the default behavior

- Probe is now enabled by default (was opt-in with --probe)
- Add --no-probe flag to skip probing if desired (faster)
- More useful default behavior for deployment scenarios
This commit is contained in:
Bob 2025-11-10 03:46:48 +00:00
parent 33fb7fead1
commit 811ef6829b
1 changed files with 8 additions and 8 deletions

View File

@ -113,8 +113,8 @@ def main():
import argparse import argparse
parser = argparse.ArgumentParser(description='ESP32 USB Device Detection') parser = argparse.ArgumentParser(description='ESP32 USB Device Detection')
parser.add_argument('--probe', action='store_true', parser.add_argument('--no-probe', action='store_true',
help='Probe each device to detect exact chip type (slower)') help='Skip chip type probing (faster, less accurate)')
args = parser.parse_args() args = parser.parse_args()
print("=" * 60) print("=" * 60)
@ -137,9 +137,9 @@ def main():
if device.vid is not None and device.pid is not None: if device.vid is not None and device.pid is not None:
print(f" VID:PID: {device.vid:04X}:{device.pid:04X}") print(f" VID:PID: {device.vid:04X}:{device.pid:04X}")
# Chip type detection # Chip type detection (probe by default)
chip_type = None chip_type = None
if args.probe: if not args.no_probe:
print(f" Probing chip type...", end='', flush=True) print(f" Probing chip type...", end='', flush=True)
chip_type = detect_chip_type(device.device) chip_type = detect_chip_type(device.device)
print(f"\r Chip Type: {chip_type}") print(f"\r Chip Type: {chip_type}")
@ -148,9 +148,9 @@ def main():
if device.vid is not None and device.pid is not None: if device.vid is not None and device.pid is not None:
chip_type = guess_chip_type_from_usb(device.vid, device.pid) chip_type = guess_chip_type_from_usb(device.vid, device.pid)
if chip_type: if chip_type:
print(f" Chip Guess: {chip_type} (use --probe for exact type)") print(f" Chip Guess: {chip_type} (remove --no-probe for exact type)")
else: else:
print(f" Chip Type: Unknown (use --probe to detect)") print(f" Chip Type: Unknown (remove --no-probe to detect)")
if device.manufacturer: if device.manufacturer:
print(f" Manufacturer: {device.manufacturer}") print(f" Manufacturer: {device.manufacturer}")
@ -162,8 +162,8 @@ def main():
print("=" * 60) print("=" * 60)
print(f"Total ESP32 devices detected: {len(esp32_devices)}") print(f"Total ESP32 devices detected: {len(esp32_devices)}")
if not args.probe: if args.no_probe:
print("Tip: Use --probe flag to detect exact chip types") print("Tip: Remove --no-probe flag to detect exact chip types")
print("=" * 60) print("=" * 60)
else: else:
print("No ESP32 devices detected.") print("No ESP32 devices detected.")