sdi->connection_id = g_strdup(connection_id);
/* Logic channels, all in one channel group. */
- cg = g_malloc0(sizeof(struct sr_channel_group));
- cg->name = g_strdup("Logic");
+ cg = sr_channel_group_new(sdi, "Logic", NULL);
for (j = 0; j < NUM_CHANNELS; j++) {
sprintf(channel_name, "%d", j);
ch = sr_channel_new(sdi, j, SR_CHANNEL_LOGIC,
TRUE, channel_name);
cg->channels = g_slist_append(cg->channels, ch);
}
- sdi->channel_groups = g_slist_append(NULL, cg);
devc = dslogic_dev_new();
devc->profile = prof;
libusb_get_device_address(devlist[i]), NULL);
} else {
if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i],
- USB_CONFIGURATION, prof->firmware) == SR_OK)
+ USB_CONFIGURATION, prof->firmware) == SR_OK) {
/* Store when this device's FW was updated. */
devc->fw_updated = g_get_monotonic_time();
- else
+ } else {
sr_err("Firmware upload failed for "
- "device %d.%d (logical).",
+ "device %d.%d (logical), name %s.",
libusb_get_bus_number(devlist[i]),
- libusb_get_device_address(devlist[i]));
+ libusb_get_device_address(devlist[i]),
+ prof->firmware);
+ }
sdi->inst_type = SR_INST_USB;
sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
0xff, NULL);
devc->cur_samplerate = devc->samplerates[0];
}
- if (devc->cur_threshold == 0.0)
+ if (devc->cur_threshold == 0.0) {
devc->cur_threshold = thresholds[1][0];
+ return dslogic_set_voltage_threshold(sdi, devc->cur_threshold);
+ }
return SR_OK;
}