diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2017-06-18 19:12:11 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-06-21 17:45:14 +0200 |
commit | 96e1cee7eb34f5ff5b6da6011ab89ad8bc1ac794 (patch) | |
tree | 76969ebdfb48cdf85594960a1f78c03c8e02cc0b /decoders/timing | |
parent | c240da484645ab78b19c8a8e2938df67039660f0 (diff) | |
download | libsigrokdecode-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 'decoders/timing')
0 files changed, 0 insertions, 0 deletions