]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/dreamsourcelab-dslogic/protocol.c
hantek-4032l: Implement trigger handling.
[libsigrok.git] / src / hardware / dreamsourcelab-dslogic / protocol.c
index 863b4e3bac6f9a7ba88a6f25d768440dcc935c91..0f171518125c5aa320ba0791de3a875df182f8d9 100644 (file)
@@ -568,7 +568,9 @@ SR_PRIV int dslogic_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
                if ((sdi->status == SR_ST_INITIALIZING) ||
                                (sdi->status == SR_ST_INACTIVE)) {
                        /* 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;
@@ -738,7 +740,7 @@ static void deinterleave_buffer(const uint8_t *src, size_t length,
                                const uint16_t m = channel_mask >> channel;
                                if (!m)
                                        break;
-                               if ((m & 1) && ((*word_ptr++ >> bit) & 1ULL))
+                               if ((m & 1) && ((*word_ptr++ >> bit) & UINT64_C(1)))
                                        sample |= 1 << channel;
                        }
                        *dst_ptr++ = sample;