From 40a0b2f4667d9ca13c83821a16997a2264f6a2a7 Mon Sep 17 00:00:00 2001 From: Helge Kruse Date: Sat, 30 Jan 2021 14:49:02 +0100 Subject: [PATCH] kingst-la2016: Upload firmware to correct USB configuration 1 The ezusb_upload_firmware() routine opens the USB device and selects the current configuration. The specified value must match the previously read configuration descriptor. This commit unbreaks the firmware download for MinGW builds which link against libusb-1.0.20-rc3-event-abstraction-v4. [ gsi: reworded commit message ] --- src/hardware/kingst-la2016/protocol.c | 2 +- src/hardware/kingst-la2016/protocol.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hardware/kingst-la2016/protocol.c b/src/hardware/kingst-la2016/protocol.c index 0b4a8bf3..bf181597 100644 --- a/src/hardware/kingst-la2016/protocol.c +++ b/src/hardware/kingst-la2016/protocol.c @@ -502,7 +502,7 @@ SR_PRIV int la2016_upload_firmware(struct sr_context *sr_ctx, libusb_device *dev { char fw_file[1024]; snprintf(fw_file, sizeof(fw_file) - 1, UC_FIRMWARE, product_id); - return ezusb_upload_firmware(sr_ctx, dev, 0, fw_file); + return ezusb_upload_firmware(sr_ctx, dev, USB_CONFIGURATION, fw_file); } SR_PRIV int la2016_setup_acquisition(const struct sr_dev_inst *sdi) diff --git a/src/hardware/kingst-la2016/protocol.h b/src/hardware/kingst-la2016/protocol.h index 43c079d6..061168e2 100644 --- a/src/hardware/kingst-la2016/protocol.h +++ b/src/hardware/kingst-la2016/protocol.h @@ -35,6 +35,7 @@ #define LA2016_VID 0x77a1 #define LA2016_PID 0x01a2 #define USB_INTERFACE 0 +#define USB_CONFIGURATION 1 #define LA2016_BULK_MAX 8388608 -- 2.30.2