FreeCalypso > hg > fc-usbser-tools
diff cp2102/read_eeprom_main.c @ 97:8d35346f1d46
cp2102 tools: accept "default" as device-selector
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 Sep 2023 03:26:11 +0000 |
parents | a378bf95c26c |
children | 1cacc1ae56f0 |
line wrap: on
line diff
--- a/cp2102/read_eeprom_main.c Thu Sep 28 02:38:59 2023 +0000 +++ b/cp2102/read_eeprom_main.c Thu Sep 28 03:26:11 2023 +0000 @@ -15,6 +15,8 @@ #include "../libuwrap/find_dev.h" #include "cp210x_defs.h" +extern struct usb_device *find_cp2102_device(); + u_char eeprom[SIZE_EEPROM]; main(argc, argv) @@ -29,11 +31,7 @@ argv[0]); exit(1); } - dev = find_usbdev_by_desc_string(argv[1]); - if (!dev) { - fprintf(stderr, "error: specified USB device not found\n"); - exit(1); - } + dev = find_cp2102_device(argv[1]); usbh = usb_open(dev); if (!usbh) { fprintf(stderr, "error: usb_open() failed\n");