]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Fix continuous mode.
authorBert Vermeulen <redacted>
Tue, 22 Jul 2014 22:24:23 +0000 (00:24 +0200)
committerBert Vermeulen <redacted>
Tue, 22 Jul 2014 22:24:39 +0000 (00:24 +0200)
src/hardware/fx2lafw/protocol.c

index 433f9075c03c2d9cf804ec8d02962ebfef28e466..64b440f642076a49916bd00770403693370bf447 100644 (file)
@@ -448,11 +448,11 @@ SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer)
        }
 
        if (devc->trigger_fired) {
-               if (devc->sent_samples < devc->limit_samples) {
+               if (!devc->limit_samples || devc->sent_samples < devc->limit_samples) {
                        /* Send the incoming transfer to the session bus. */
                        packet.type = SR_DF_LOGIC;
                        packet.payload = &logic;
-                       if (devc->sent_samples + cur_sample_count > devc->limit_samples)
+                       if (devc->limit_samples && devc->sent_samples + cur_sample_count > devc->limit_samples)
                                num_samples = devc->limit_samples - devc->sent_samples;
                        else
                                num_samples = cur_sample_count;