]> sigrok.org Git - libsigrok.git/commitdiff
beaglelogic: Fix regression in continuous sampling
authorKumar Abhishek <redacted>
Sat, 23 Sep 2017 12:49:13 +0000 (18:19 +0530)
committerUwe Hermann <redacted>
Tue, 26 Sep 2017 16:14:46 +0000 (18:14 +0200)
Signed-off-by: Kumar Abhishek <redacted>
src/hardware/beaglelogic/api.c
src/hardware/beaglelogic/protocol.c

index b2384d5f33b55557f11f65d85348715aa4e17a47..024c668138346167f6e56e0a0a75d4bb33ac4162 100644 (file)
@@ -341,6 +341,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        }
        devc->beaglelogic->set_sampleunit(devc);
 
+       /* If continuous sampling, set the limit_samples to max possible value */
+       if (devc->triggerflags == BL_TRIGGERFLAGS_CONTINUOUS) {
+               devc->limit_samples = (uint64_t)-1;
+       }
+
        /* Configure triggers & send header packet */
        if ((trigger = sr_session_trigger_get(sdi->session))) {
                int pre_trigger_samples = 0;
index 621a73dcece1492020566f565fa9017a9d900b19..0fc6f123942c3dce6d6f4bb17571a9745a652c94 100644 (file)
@@ -99,7 +99,7 @@ SR_PRIV int beaglelogic_native_receive_data(int fd, int revents, void *cb_data)
                if ((devc->offset += packetsize) >= devc->buffersize) {
                        /* One shot capture, we abort and settle with less than
                         * the required number of samples */
-                       if (devc->triggerflags)
+                       if (devc->triggerflags == BL_TRIGGERFLAGS_CONTINUOUS)
                                devc->offset = 0;
                        else
                                packetsize = 0;
@@ -181,7 +181,7 @@ SR_PRIV int beaglelogic_tcp_receive_data(int fd, int revents, void *cb_data)
                if ((devc->offset += packetsize) >= devc->buffersize) {
                        /* One shot capture, we abort and settle with less than
                         * the required number of samples */
-                       if (devc->triggerflags)
+                       if (devc->triggerflags == BL_TRIGGERFLAGS_CONTINUOUS)
                                devc->offset = 0;
                        else
                                packetsize = 0;