]> sigrok.org Git - libsigrok.git/blobdiff - hardware/demo/demo.c
rigol-ds1xx2: More selective Rigol DS1xx2 scan
[libsigrok.git] / hardware / demo / demo.c
index aac585a2f3212311372ab617d8bd0dc409a3a194..b02e668c01b020327a08b024c30c3e9fe4b81f94 100644 (file)
@@ -111,14 +111,7 @@ static const char *pattern_strings[] = {
 
 /* We name the probes 0-7 on our demo driver. */
 static const char *probe_names[NUM_PROBES + 1] = {
-       "0",
-       "1",
-       "2",
-       "3",
-       "4",
-       "5",
-       "6",
-       "7",
+       "0", "1", "2", "3", "4", "5", "6", "7",
        NULL,
 };
 
@@ -389,11 +382,8 @@ static int receive_data(int fd, int revents, void *cb_data)
                devc->samples_counter += sending_now;
        }
 
-
-       if (devc->samples_counter >= limit_samples) {
-               sr_spew("We sent a total of %" PRIu64 " samples.",
-                       devc->samples_counter);
-               /* Make sure we don't receive more packets. */
+       if (limit_samples && devc->samples_counter >= limit_samples) {
+               sr_info("Requested number of samples reached.");
                hw_dev_acquisition_stop(NULL, cb_data);
                return TRUE;
        }