From 36cd837fc9382c8ccc5da2a562c261f2a47a9736 Mon Sep 17 00:00:00 2001 From: JohannesTaelman Date: Tue, 13 Aug 2013 15:37:44 +0200 Subject: [PATCH] fixed USB VID/PID detection bug When a USB device with same VID but different PID is found, it got selected as STLINK device. --- src/stlink-usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stlink-usb.c b/src/stlink-usb.c index d574584..9895da8 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -754,7 +754,10 @@ stlink_t* stlink_open_usb(const int verbose) { if (devBus && devAddr) if ((libusb_get_bus_number(list[cnt])!=devBus) || (libusb_get_device_address(list[cnt])!=devAddr)) continue; if (desc.idProduct == USB_STLINK_32L_PID) break; - if (desc.idProduct == USB_STLINK_PID) slu->protocoll = 1; break; + if (desc.idProduct == USB_STLINK_PID) { + slu->protocoll = 1; + break; + } } if (cnt < 0) { -- 2.47.2