]> sigrok.org Git - libsigrok.git/commitdiff
Demo: Fix #314 by always honoring sample limit changes
authorDaniel King <redacted>
Mon, 6 Jul 2015 19:16:29 +0000 (21:16 +0200)
committerUwe Hermann <redacted>
Thu, 9 Jul 2015 18:22:51 +0000 (20:22 +0200)
src/hardware/demo/demo.c

index b6a561afbc71843cfe6398dc7c0f02db99e8143e..5128b9dc652094b75790d626fae7b2936bdc7f10 100644 (file)
@@ -777,9 +777,9 @@ static int prepare_data(int fd, int revents, void *cb_data)
                expected_samplenum = MIN(expected_samplenum, devc->limit_samples);
 
        /* Of those, how many do we still have to send? */
-       if (devc->num_logic_channels)
+       if (devc->num_logic_channels && (devc->logic_counter < devc->limit_samples))
                logic_todo = expected_samplenum - devc->logic_counter;
-       if (devc->num_analog_channels)
+       if (devc->num_analog_channels && (devc->analog_counter < devc->limit_samples))
                analog_todo = expected_samplenum - devc->analog_counter;
 
        while (logic_todo || analog_todo) {