]> sigrok.org Git - libsigrok.git/commitdiff
sw_limits: extend API to "get remaining counts" before the limit is reached
authorGerhard Sittig <redacted>
Tue, 12 Oct 2021 14:34:32 +0000 (16:34 +0200)
committerGerhard Sittig <redacted>
Wed, 13 Oct 2021 16:09:11 +0000 (18:09 +0200)
The current sw_limits API provides routines which interface nicely with
config get/set and Glib data types, and which check whether a limit was
exceeded after previous submission of samples (summary result).

Device drivers may want to check _before_ a limit was reached, some may
want to cap to-get-submitted sample data such that a limit gets reached
but is not exceeded. This need becomes more obvious when devices with
efficient hardware compression "severely overshoot" the user specified
limits when the check is only done late after submission of another
chunk of data which results from uncompression.

Introduce an API routine which gets the remaining count until the limit
is reached. Phrase the implementation for cheapest cost of execution.
These routines may execute in tight loops in acquisition code paths.


No differences found