X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flecroy-xstream%2Fapi.c;h=480866474b747791957df86f201b4912dc17c205;hb=093e1cba6b7bf14cfb77fa36f59b0c16e6fca7cc;hp=25c11485b77318dd85df49f6fe1187d0227a7870;hpb=90230cfa7f7ae62b21169fa2156f54e2902e7ad1;p=libsigrok.git diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index 25c11485..48086647 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -38,18 +38,18 @@ static const uint32_t drvopts[] = { static const uint32_t devopts[] = { SR_CONF_LIMIT_FRAMES | SR_CONF_GET | SR_CONF_SET, - SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_SAMPLERATE | SR_CONF_GET, SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_NUM_HDIV | SR_CONF_GET, - SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET, - SR_CONF_SAMPLERATE | SR_CONF_GET, + SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; static const uint32_t analog_devopts[] = { SR_CONF_NUM_VDIV | SR_CONF_GET, - SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; static int check_manufacturer(const char *manufacturer) @@ -104,8 +104,7 @@ static struct sr_dev_inst *probe_serial_device(struct sr_scpi_dev_inst *scpi) fail: sr_scpi_hw_info_free(hw_info); - if (sdi) - sr_dev_inst_free(sdi); + sr_dev_inst_free(sdi); g_free(devc); return NULL; @@ -149,9 +148,6 @@ static int dev_open(struct sr_dev_inst *sdi) static int dev_close(struct sr_dev_inst *sdi) { - if (sdi->status == SR_ST_INACTIVE) - return SR_OK; - sr_scpi_close(sdi->conn); sdi->status = SR_ST_INACTIVE; @@ -554,9 +550,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) int ret; struct sr_scpi_dev_inst *scpi; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; scpi = sdi->conn; /* Preset empty results. */ @@ -617,9 +610,6 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) std_session_send_df_end(sdi); - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; devc->num_frames = 0;