X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=986b02571d6617998d2a9e3ad92d7b9295c975c5;hb=6402c379161ec138e451901c411817a55846a75b;hp=95c9f9e72806ccbd097d9cd88eeecb72db54a595;hpb=dd5c48a6d567a3cac62c4b0058588273bbeea171;p=libsigrok.git diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index 95c9f9e7..986b0257 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -86,9 +86,11 @@ static const uint64_t samplerates[] = { SR_MHZ(10), SR_KHZ(12500), SR_MHZ(16), + SR_MHZ(20), SR_MHZ(25), SR_MHZ(32), SR_MHZ(40), + SR_MHZ(50), SR_MHZ(80), SR_MHZ(100), }; @@ -189,17 +191,15 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup("Saleae"); sdi->model = g_strdup("Logic16"); - sdi->driver = di; sdi->connection_id = g_strdup(connection_id); for (j = 0; j < ARRAY_SIZE(channel_names); j++) sr_channel_new(sdi, j, SR_CHANNEL_LOGIC, TRUE, - channel_names[j]); + channel_names[j]); devc = g_malloc0(sizeof(struct dev_context)); devc->selected_voltage_range = VOLTAGE_RANGE_18_33_V; sdi->priv = devc; - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); if (check_conf_profile(devlist[i])) { @@ -225,7 +225,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_free_device_list(devlist, 1); g_slist_free_full(conn_devices, (GDestroyNotify)sr_usb_dev_inst_free); - return devices; + return std_scan_complete(di, devices); } static int logic16_dev_open(struct sr_dev_inst *sdi) @@ -242,10 +242,6 @@ static int logic16_dev_open(struct sr_dev_inst *sdi) drvc = di->context; usb = sdi->conn; - if (sdi->status == SR_ST_ACTIVE) - /* Device is already in use. */ - return SR_ERR; - device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); if (device_count < 0) { sr_err("Failed to get device list: %s.", @@ -460,9 +456,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd (void)cg; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; ret = SR_OK; @@ -674,9 +667,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) unsigned char *buf; size_t size, convsize; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - drvc = di->context; devc = sdi->priv; usb = sdi->conn; @@ -761,7 +751,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) usb_source_add(sdi->session, devc->ctx, timeout, receive_data, (void *)sdi); - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); if ((ret = logic16_start_acquisition(sdi)) != SR_OK) { abort_acquisition(devc); @@ -775,9 +765,6 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) { int ret; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - ret = logic16_abort_acquisition(sdi); abort_acquisition(sdi->priv);