]> sigrok.org Git - libsigrok.git/commit - src/hardware/asix-sigma/api.c
asix-sigma: rework time/count limits support, accept more samplerates
authorGerhard Sittig <redacted>
Sun, 10 May 2020 14:45:17 +0000 (16:45 +0200)
committerGerhard Sittig <redacted>
Fri, 29 May 2020 05:50:18 +0000 (07:50 +0200)
commit5e78a56481769db6ffe9b9fd392d71be3fcf0319
tree62991a8374ca361c0b911756c455261c31319996
parent98b43eb3cdb3dcef3511f2588163fd82c7f56143
asix-sigma: rework time/count limits support, accept more samplerates

Use common support for SW limits, and untangle the formerly convoluted
logic for sample count or time limits. Accept user provided samplerate
values when the hardware supports them, also those which are not listed.

The previous implementation mapped sample count limits to timeout specs
which depend on the samplerate. The order of applications' calls into
the config set routines is unspecified, the use of one common storage
space led to an arbitrary resulting value for the msecs limit, and loss
of user specified values for read-back.

Separate the input which was specified by applications, from limits
which were derived from this input and determine the acquisition phase's
duration, from sample count limits which apply to sample data download
and session feed submission after the acquisition finished. This allows
to configure the values in any order, to read back previously configured
values, and to run arbitrary numbers of acquisition and download cycles
without losing input specs.

This commit also concentrates all the limits related computation in a
single location at the start of the acquisition. Moves the submission
buffer's count limit container to the device context where the other
limits are kept as well. Renames the samplerate variable, and drops an
aggressive check for supported rates (now uses hardware constraints as
the only condition). Removes an unused variable in the device context.
src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.c
src/hardware/asix-sigma/protocol.h