SR_MHZ(50),
SR_MHZ(100),
SR_MHZ(125),
- /* fast mode not supported yet
+ /* Fast mode not supported yet.
SR_MHZ(200),
SR_MHZ(250), */
};
libusb_get_device_descriptor(devlist[i], &des);
- usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+ if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+ continue;
prof = NULL;
for (j = 0; dev_profiles[j].orig_vid; j++) {
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
- USB_CONFIGURATION, prof->firmware) == SR_OK)
+ USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Remember when the firmware on this device was updated */
devc->fw_updated = g_get_monotonic_time();
- else
- sr_err("Firmware upload failed");
+ } else {
+ sr_err("Firmware upload failed, name %s", prof->firmware);
+ }
/* Dummy USB address of 0xff will get overwritten later. */
sdi->conn = sr_usb_dev_inst_new(
libusb_get_bus_number(devlist[i]), 0xff, NULL);
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
- int rat;
int ch_idx, idx;
float flt;
sr_err("Trigger level must be in [0.0,1.0].");
return SR_ERR_ARG;
}
-
devc->voffset_trigger = flt;
- if (dso_set_voffsets(sdi) != SR_OK) {
- return SR_ERR;
- }
+ if (dso_set_voffsets(sdi) != SR_OK)
+ return SR_ERR;
break;
case SR_CONF_TRIGGER_SLOPE:
if ((idx = std_str_idx(data, ARRAY_AND_SIZE(trigger_slopes))) < 0)
devc->triggerslope = idx;
break;
case SR_CONF_CAPTURE_RATIO:
- rat = g_variant_get_uint64(data);
- if (rat < 0 || rat > 100) {
- sr_err("Capture ratio must be in [0,100].");
- return SR_ERR_ARG;
- } else
- devc->capture_ratio = rat;
+ devc->capture_ratio = g_variant_get_uint64(data);
break;
case SR_CONF_BUFFERSIZE:
if ((idx = std_u64_idx(data, devc->profile->buffersizes, NUM_BUFFER_SIZES)) < 0)
devc->samplerate = samplerates[idx];
if (dso_set_trigger_samplerate(sdi) != SR_OK)
return SR_ERR;
- sr_dbg("got new sample rate %d, idx %d", devc->samplerate, idx);
break;
case SR_CONF_TRIGGER_SOURCE:
if ((idx = std_str_idx(data, ARRAY_AND_SIZE(trigger_sources))) < 0)
/* No data yet. */
break;
case CAPTURE_READY_8BIT:
- case CAPTURE_READY2250:
+ case CAPTURE_READY_2250:
/* Remember where in the captured frame the trigger is. */
devc->trigger_offset = trigger_offset;