+ if (!fx2_prof)
+ /* not a supported VID/PID */
+ continue;
+
+ sdi = sr_device_instance_new(devcnt, SR_ST_INITIALIZING,
+ fx2_prof->vendor, fx2_prof->model, fx2_prof->model_version);
+ if (!sdi)
+ return 0;
+ fx2 = fx2_device_new();
+ fx2->profile = fx2_prof;
+ sdi->priv = fx2;
+ device_instances = g_slist_append(device_instances, sdi);
+
+ if (check_conf_profile(devlist[i])) {
+ /* Already has the firmware, so fix the new address. */
+ sr_dbg("Found a Saleae Logic with %s firmware.",
+ new_saleae_logic_firmware ? "new" : "old");
+ sdi->status = SR_ST_INACTIVE;
+ fx2->usb = sr_usb_device_instance_new
+ (libusb_get_bus_number(devlist[i]),
+ libusb_get_device_address(devlist[i]), NULL);
+ } else {
+ if (ezusb_upload_firmware(devlist[i], USB_CONFIGURATION, FIRMWARE) == SR_OK)
+ /* Remember when the firmware on this device was updated */
+ g_get_current_time(&fx2->fw_updated);
+ else
+ sr_err("firmware upload failed for device %d", devcnt);
+ fx2->usb = sr_usb_device_instance_new
+ (libusb_get_bus_number(devlist[i]), 0xff, NULL);
+ }
+ devcnt++;