From: Kumar Abhishek Date: Sat, 23 Sep 2017 12:49:13 +0000 (+0530) Subject: beaglelogic: Fix regression in continuous sampling X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ca0d1a21afaa22343534788d3d55b919f58b4386;p=libsigrok.git beaglelogic: Fix regression in continuous sampling Signed-off-by: Kumar Abhishek --- diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index b2384d5f..024c6681 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -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; diff --git a/src/hardware/beaglelogic/protocol.c b/src/hardware/beaglelogic/protocol.c index 621a73dc..0fc6f123 100644 --- a/src/hardware/beaglelogic/protocol.c +++ b/src/hardware/beaglelogic/protocol.c @@ -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;