From: Martin Ling Date: Fri, 27 Dec 2013 22:13:21 +0000 (+0100) Subject: rigol-ds: Select channels before issuing RUN command. X-Git-Tag: libsigrok-0.3.0~390 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1fed20cb387550e858a48a59a2c42e96b7b01541;p=libsigrok.git rigol-ds: Select channels before issuing RUN command. --- diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index 5a78b67c..f18271e0 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -790,19 +790,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) scpi = sdi->conn; devc = sdi->priv; - if (devc->data_source == DATA_SOURCE_LIVE) { - if (sr_scpi_send(sdi->conn, ":RUN") != SR_OK) - return SR_ERR; - } else if (devc->data_source == DATA_SOURCE_MEMORY) { - if (devc->model->series != RIGOL_DS2000) { - sr_err("Data source 'Memory' not supported for this device"); - return SR_ERR; - } - } else if (devc->data_source == DATA_SOURCE_SEGMENTED) { - sr_err("Data source 'Segmented' not yet supported"); - return SR_ERR; - } - for (l = sdi->probes; l; l = l->next) { probe = l->data; sr_dbg("handling probe %s", probe->name); @@ -830,9 +817,23 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) } } } + if (!devc->enabled_analog_probes && !devc->enabled_digital_probes) return SR_ERR; + if (devc->data_source == DATA_SOURCE_LIVE) { + if (sr_scpi_send(sdi->conn, ":RUN") != SR_OK) + return SR_ERR; + } else if (devc->data_source == DATA_SOURCE_MEMORY) { + if (devc->model->series != RIGOL_DS2000) { + sr_err("Data source 'Memory' not supported for this device"); + return SR_ERR; + } + } else if (devc->data_source == DATA_SOURCE_SEGMENTED) { + sr_err("Data source 'Segmented' not yet supported"); + return SR_ERR; + } + sr_scpi_source_add(scpi, G_IO_IN, 50, rigol_ds_receive, (void *)sdi); /* Send header packet to the session bus. */