]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/protocol.c
uni-t-ut181a: implement device driver for the UNI-T UT181A multimeter
[libsigrok.git] / src / hardware / fx2lafw / protocol.c
index fc6fd3315a2c2ab6f76a3612e7e30db1362888f0..83315808d0eca129d1e37503d0375ec22de8f250 100644 (file)
@@ -112,7 +112,7 @@ static int command_start_acquisition(const struct sr_dev_inst *sdi)
        sr_dbg("GPIF delay = %d, clocksource = %sMHz.", delay,
                (cmd.flags & CMD_START_FLAGS_CLK_48MHZ) ? "48" : "30");
 
-       if (delay <= 0 || delay > MAX_SAMPLE_DELAY) {
+       if (delay < 0 || delay > MAX_SAMPLE_DELAY) {
                sr_err("Unable to sample at %" PRIu64 "Hz.", samplerate);
                return SR_ERR;
        }
@@ -174,7 +174,9 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
                        /*
                         * 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;