hosted/jlink: fix vid-pid transposition error

This commit is contained in:
Rafael Silva 2022-08-01 22:42:06 +01:00 committed by Rachel Mant
parent 0077d31be3
commit 46fd32da5c
1 changed files with 8 additions and 8 deletions

View File

@ -33,12 +33,12 @@
#include "cli.h" #include "cli.h"
#include "jlink.h" #include "jlink.h"
#define USB_PID_SEGGER 0x1366 #define USB_VID_SEGGER 0x1366
/* Only two devices PIDS tested so long */ /* Only two devices PIDS tested so long */
#define USB_VID_SEGGER_0101 0x0101 #define USB_PID_SEGGER_0101 0x0101
#define USB_VID_SEGGER_0105 0x0105 #define USB_PID_SEGGER_0105 0x0105
#define USB_VID_SEGGER_1020 0x1020 #define USB_PID_SEGGER_1020 0x1020
static uint32_t emu_caps; static uint32_t emu_caps;
static uint32_t emu_speed_kHz; static uint32_t emu_speed_kHz;
@ -180,11 +180,11 @@ int jlink_init(bmp_info_t *info)
DEBUG_WARN( "libusb_get_device_descriptor() failed"); DEBUG_WARN( "libusb_get_device_descriptor() failed");
goto error;; goto error;;
} }
if (desc.idVendor != USB_PID_SEGGER) if (desc.idVendor != USB_VID_SEGGER)
continue; continue;
if ((desc.idProduct != USB_VID_SEGGER_0101) && if ((desc.idProduct != USB_PID_SEGGER_0101) &&
(desc.idProduct != USB_VID_SEGGER_0105) && (desc.idProduct != USB_PID_SEGGER_0105) &&
(desc.idProduct != USB_VID_SEGGER_1020)) (desc.idProduct != USB_PID_SEGGER_1020))
continue; continue;
int res = libusb_open(dev, &jl->ul_libusb_device_handle); int res = libusb_open(dev, &jl->ul_libusb_device_handle);
if (res != LIBUSB_SUCCESS) if (res != LIBUSB_SUCCESS)