]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hantek-dso/protocol.c
scpi-pps: don't break SCPI devices when scanning for HP-IB devices
[libsigrok.git] / src / hardware / hantek-dso / protocol.c
index 39d87c4433bb316564e0cdff84df818b76c2f808..d2101f2a8170c892af1311c7a0e12f482aa3d84e 100644 (file)
@@ -130,7 +130,9 @@ SR_PRIV int dso_open(struct sr_dev_inst *sdi)
                        /*
                         * Check device by its physical USB bus/port address.
                         */
-                       usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+                       if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+                               continue;
+
                        if (strcmp(sdi->connection_id, connection_id))
                                /* This is not the one. */
                                continue;
@@ -324,7 +326,8 @@ static int dso2250_set_trigger_samplerate(const struct sr_dev_inst *sdi)
        }
 
        tmp = base / devc->samplerate;
-       if (tmp) {
+       /* Downsample only if really necessary */
+       if (tmp > 1) {
                /* Downsampling on */
                cmdstring[2] |= 2;
                /* Downsampler = 1comp((Base / Samplerate) - 2)