]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/openbench-logic-sniffer/api.c
ols: extend reponse delay when scanning device
[libsigrok.git] / src / hardware / openbench-logic-sniffer / api.c
index 1aa7844e80d9c4f34e614f647a462c6fff5659aa..26490c05aafd89e901f9e56e646f539fabf68a99 100644 (file)
@@ -83,7 +83,7 @@ static const uint64_t samplerates[] = {
        SR_HZ(1),
 };
 
-#define RESPONSE_DELAY_US (10 * 1000)
+#define RESPONSE_DELAY_US (20 * 1000)
 
 static GSList *scan(struct sr_dev_driver *di, GSList *options)
 {
@@ -417,14 +417,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        /*
         * Limit readcount to prevent reading past the end of the hardware
-        * buffer.
+        * buffer. Rather read too many samples than too few.
         */
        samplecount = MIN(devc->max_samples / num_ols_changrp, devc->limit_samples);
-       readcount = samplecount / 4;
-
-       /* Rather read too many samples than too few. */
-       if (samplecount % 4 != 0)
-               readcount++;
+       readcount = (samplecount + 3) / 4;
 
        /* Basic triggers. */
        if (ols_convert_trigger(sdi) != SR_OK) {