serial-dmm: Properly handle continuous mode

serial-dmm does not check if a sample limit is actually in place before deciding
to stop acquisition. Since the sample limit is set at 0 by default, operating
in continuous mode will cause acquisition to stop before even sending the first
sample.

Check to make sure we actually are in a sample-limited mode before stopping for
this reason.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
Alexandru Gagniuc 2012-12-22 16:00:44 -06:00 committed by Uwe Hermann
parent 17dfb2c32c
commit d55c89f523
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ static int receive_data(int fd, int revents, int dmm, void *info, void *cb_data)
}
}
if (devc->num_samples >= devc->limit_samples) {
if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
sr_info("Requested number of samples reached, stopping.");
sdi->driver->dev_acquisition_stop(sdi, cb_data);
return TRUE;