FIRMWARE_DIR "/fx2lafw-cwav-usbeesx.fw",
0, NULL, NULL},
- /*
- * DreamSourceLab DSLogic (before FW upload)
- */
+ /* DreamSourceLab DSLogic (before FW upload) */
{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
FIRMWARE_DIR "/dreamsourcelab-dslogic-fx2.fw",
DEV_CAPS_16BIT, NULL, NULL},
-
- /*
- * DreamSourceLab DSLogic (after FW upload)
- */
+ /* DreamSourceLab DSLogic (after FW upload) */
{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
FIRMWARE_DIR "/dreamsourcelab-dslogic-fx2.fw",
DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
+ /* DreamSourceLab DSCope (before FW upload) */
+ { 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
+ FIRMWARE_DIR "/dreamsourcelab-dscope-fx2.fw",
+ DEV_CAPS_16BIT, NULL, NULL},
+ /* DreamSourceLab DSCope (after FW upload) */
+ { 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
+ FIRMWARE_DIR "/dreamsourcelab-dscope-fx2.fw",
+ DEV_CAPS_16BIT, "DreamSourceLab", "DSCope"},
+
+ /* DreamSourceLab DSLogic Pro (before FW upload) */
+ { 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
+ FIRMWARE_DIR "/dreamsourcelab-dslogic-pro-fx2.fw",
+ DEV_CAPS_16BIT, NULL, NULL},
+ /* DreamSourceLab DSLogic Pro (after FW upload) */
+ { 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
+ FIRMWARE_DIR "/dreamsourcelab-dslogic-pro-fx2.fw",
+ DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
+
/*
* Saleae Logic
* EE Electronics ESLA100
drvc->instances = g_slist_append(drvc->instances, sdi);
devices = g_slist_append(devices, sdi);
- if (strcmp(prof->model, "DSLogic")) {
+ if (!strcmp(prof->model, "DSLogic")
+ || !strcmp(prof->model, "DSLogic Pro")
+ || !strcmp(prof->model, "DSCope")) {
+ devc->dslogic = TRUE;
+ devc->samplerates = dslogic_samplerates;
+ devc->num_samplerates = ARRAY_SIZE(dslogic_samplerates);
+ has_firmware = match_manuf_prod(devlist[i], "DreamSourceLab", "DSLogic")
+ || match_manuf_prod(devlist[i], "DreamSourceLab", "DSCope");
+ } else {
devc->dslogic = FALSE;
devc->samplerates = samplerates;
devc->num_samplerates = ARRAY_SIZE(samplerates);
has_firmware = match_manuf_prod(devlist[i],
"sigrok", "fx2lafw");
- } else {
- devc->dslogic = TRUE;
- devc->samplerates = dslogic_samplerates;
- devc->num_samplerates = ARRAY_SIZE(dslogic_samplerates);
- has_firmware = match_manuf_prod(devlist[i],
- "DreamSourceLab", "DSLogic");
}
if (has_firmware) {
struct sr_dev_driver *di = sdi->driver;
struct sr_usb_dev_inst *usb;
struct dev_context *devc;
+ char *fpga_firmware = NULL;
int ret;
int64_t timediff_us, timediff_ms;
devc = sdi->priv;
usb = sdi->conn;
+ if (libusb_has_capability(LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER)) {
+ if (libusb_kernel_driver_active(usb->devhdl, 0) == 1) {
+ if ((ret = libusb_detach_kernel_driver(usb->devhdl, 0)) < 0) {
+ sr_err("Failed to detach kernel driver: %s.",
+ libusb_error_name(ret));
+ return SR_ERR;
+ }
+ }
+ }
+
/*
* If the firmware was recently uploaded, wait up to MAX_RENUM_DELAY_MS
* milliseconds for the FX2 to renumerate.
}
if (devc->dslogic) {
+ if (!strcmp(devc->profile->model, "DSLogic")) {
+ fpga_firmware = DSLOGIC_FPGA_FIRMWARE;
+ } else if (!strcmp(devc->profile->model, "DSLogic Pro")) {
+ fpga_firmware = DSLOGIC_PRO_FPGA_FIRMWARE;
+ } else if (!strcmp(devc->profile->model, "DSCope")) {
+ fpga_firmware = DSCOPE_FPGA_FIRMWARE;
+ }
+
if ((ret = dslogic_fpga_firmware_upload(sdi,
- DSLOGIC_FPGA_FIRMWARE)) != SR_OK)
+ fpga_firmware)) != SR_OK)
return ret;
}
{
struct dev_context *devc;
uint64_t arg;
- unsigned int i;
- int ret;
+ int i, ret;
(void)cg;
switch (key) {
case SR_CONF_SAMPLERATE:
arg = g_variant_get_uint64(data);
- for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
- if (samplerates[i] == arg) {
+ for (i = 0; i < devc->num_samplerates; i++) {
+ if (devc->samplerates[i] == arg) {
devc->cur_samplerate = arg;
break;
}
}
- if (i == ARRAY_SIZE(samplerates))
+ if (i == devc->num_samplerates)
ret = SR_ERR_ARG;
break;
case SR_CONF_LIMIT_SAMPLES:
dslogic_trigger_request(sdi);
}
else {
- if ((ret = fx2lafw_command_start_acquisition(sdi)) != SR_OK)
- return ret;
start_transfers(sdi);
+ if ((ret = fx2lafw_command_start_acquisition(sdi)) != SR_OK) {
+ fx2lafw_abort_acquisition(devc);
+ return ret;
+ }
}
return SR_OK;