summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2017-06-18 19:12:11 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2017-06-21 17:45:14 +0200
commit96e1cee7eb34f5ff5b6da6011ab89ad8bc1ac794 (patch)
tree76969ebdfb48cdf85594960a1f78c03c8e02cc0b /instance.c
parentc240da484645ab78b19c8a8e2938df67039660f0 (diff)
downloadlibsigrokdecode-96e1cee7eb34f5ff5b6da6011ab89ad8bc1ac794.tar.gz
libsigrokdecode-96e1cee7eb34f5ff5b6da6011ab89ad8bc1ac794.zip
decoder: Unbreak execution of Decoder.wait() with empty condition
The Decoder.wait() method works as expected when non-empty conditions are specified by the caller. For empty conditions the implementation was incomplete, and ended up in an infinite loop because the sample number got stuck in the current location. Code review revealed more issues like not getting more input data chunks when needed. Detect when empty wait() conditions were specified, and re-use existing code paths for match handling as much as possible. This is achieved by the manual creation of a SKIP term with the appropriate count value. It's assumed that naive decoder implementations will run this kind of condition-less query for every individual sample, which means that efficiency is important. Make sample number 0 available to condition-less calls, too. Don't skip the first sample in the input stream.
Diffstat (limited to 'instance.c')
0 files changed, 0 insertions, 0 deletions