From: Daniel King Date: Mon, 6 Jul 2015 19:16:29 +0000 (+0200) Subject: Demo: Fix #314 by always honoring sample limit changes X-Git-Tag: libsigrok-0.4.0~466 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=536141ff49330b48ed8230547a9bec738d84a309;p=libsigrok.git Demo: Fix #314 by always honoring sample limit changes --- diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index b6a561af..5128b9dc 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -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) {