]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/api.c
scpi-pps: Add configurable sr_mqflags.
[libsigrok.git] / src / hardware / scpi-pps / api.c
index 02a34499ee2d901f244bf4c446ddad781029e04d..104a020d84e06859f716b0603963a8f81f32fd89 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the libsigrok project.
  *
  * Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
- * Copyright (C) 2017 Frank Stettner <frank-stettner@gmx.net>
+ * Copyright (C) 2017,2019 Frank Stettner <frank-stettner@gmx.net>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -152,6 +152,13 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi,
                                for (l = sdi->channels; l; l = l->next) {
                                        ch = l->data;
                                        pch = ch->priv;
+                                       /* Add mqflags from channel_group_spec only to voltage
+                                        * and current channels
+                                        */
+                                       if (pch->mq == SR_MQ_VOLTAGE || pch->mq == SR_MQ_CURRENT)
+                                               pch->mqflags = cgs->mqflags;
+                                       else
+                                               pch->mqflags = 0;
                                        if (pch->hw_output_idx == j)
                                                cg->channels = g_slist_append(cg->channels, ch);
                                }
@@ -705,6 +712,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        /* Prime the pipe with the first channel. */
        devc->cur_acquisition_channel = sr_next_enabled_channel(sdi, NULL);
 
+       /* Device specific initialization before aquisition starts. */
+       if (devc->device->init_aquisition)
+               devc->device->init_aquisition(sdi);
+
        if ((ret = sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 10,
                        scpi_pps_receive_data, (void *)sdi)) != SR_OK)
                return ret;