]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: Start acquisition on the first enabled channel.
authorBert Vermeulen <redacted>
Fri, 17 Oct 2014 01:00:55 +0000 (03:00 +0200)
committerBert Vermeulen <redacted>
Fri, 17 Oct 2014 01:00:55 +0000 (03:00 +0200)
src/hardware/scpi-pps/api.c

index 813bf7f375aeeffefdc044a4220696430e1fe4f0..891236a81c655d7283159b167c502e79f34c5e16 100644 (file)
@@ -507,9 +507,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        std_session_send_df_header(sdi, LOG_PREFIX);
 
        /* Prime the pipe with the first channel's fetch. */
-       ch = sdi->channels->data;
+       ch = next_enabled_channel(sdi, NULL);
        pch = ch->priv;
-       select_channel(sdi, ch);
+       if ((ret = select_channel(sdi, ch)) != SR_OK)
+               return ret;
        if (pch->mq == SR_MQ_VOLTAGE)
                cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
        else if (pch->mq == SR_MQ_CURRENT)