X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fapi.c;h=f6478dfc5bab045ef6ea6e144c90ef72df9e906c;hb=649a4cd672e5ea14707c4591dd0426fdd87ddd5a;hp=b46d7dd5b640373499f21635c6d41f82bbfa7b95;hpb=609bfd753c4a813791a6f678f545940c6d331c20;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index b46d7dd5..f6478dfc 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2010-2012 Bert Vermeulen * @@ -290,8 +290,6 @@ static GSList *hw_scan(GSList *options) devices = NULL; - clear_instances(); - /* Find all ZEROPLUS analyzers and add them to device list. */ devcnt = 0; libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); /* TODO: Errors. */ @@ -524,10 +522,8 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) { struct dev_context *devc; - if (!sdi) { - sr_err("%s: sdi was NULL", __func__); - return SR_ERR_ARG; - } + if (sdi->status != SR_ST_ACTIVE) + return SR_ERR_DEV_CLOSED; if (!(devc = sdi->priv)) { sr_err("%s: sdi->priv was NULL", __func__); @@ -600,6 +596,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, unsigned int packet_num, n; unsigned char *buf; + if (sdi->status != SR_ST_ACTIVE) + return SR_ERR_DEV_CLOSED; + if (!(devc = sdi->priv)) { sr_err("%s: sdi->priv was NULL", __func__); return SR_ERR_ARG;