Age | Commit message (Collapse) | Author |
|
|
|
Improve robustness of the DCF77 decoder. Cope with "neiter 0 nor 1" bit
values (glitches can break the detection of pulse widths), as well as
unexpected bit numbers (more than 59 pulses per minute, can be a
follow-up error after e.g. glitches break one long pulse into two short
pulses). Do not process this invalid data, do emit error annotations.
|
|
Emit error annotations for invalid day of the week or month numbers,
instead of aborting decoder execution with an exception.
Implementation detail: Neither the Python 'in' keyword nor a .get()
method are available. That's why we have to catch the IndexError
exception.
This fixes bug #1173.
|
|
Create the text representation of a bit string by means of the builtin
.format() method and an appropriate specifier. Drop the non-obvious
sequence of bin() and slice and zfill() calls.
|
|
The previous implementation internally noticed the "want terminate"
request, and skipped decoder execution to faster get to the end of the
input stream. But an OK return code was provided in that code path, and
more input data was sent by applications (sometimes for many seconds or
few minutes).
Do return a new SRD_ERR_TERM_REQ error code, such that applications can
tell failed execution from requested termination.
|
|
It's uncertain why srd_inst_decode() which internally gets called by the
public srd_session_send() routine used to clear the want_wait_terminate
flag. This should be cleared upon decoder instance creation and state
reset, gets raised upon termination request, but shall not get cleared
in other spots, especially not upon the availability of new input data
while the stream shall be considered in the "about to terminate, skip
all subsequent execution" state.
|
|
Before this change, the loglevel check would only be performed for the
default log handler in libsigrokdecode, but not for other handlers set
via srd_log_callback_set().
This fixes bug #698.
|
|
|
|
|
|
|
|
The backtrace printing was actually already there, but was emitted using
sr_dbg(), which doesn't show up by default for most users. Make it an
srd_err() so that most users will see it.
This fixes bug #1158.
|
|
The decoder assumed a CRC cannot end with a stuffed bit but it actually can,
and the CRC delimiter then comes after the stuffed bit.
Patch by IRC/github user celeron55, wide testing by PeterMortensen, thanks!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Introduce a "reset" group of tests. Whip up a first test step which runs
the "terminate and reset" routine for decoder stacks after session
creation, start, and meta data setup. No input data gets processed, no
decoder output is tested yet.
|
|
Implement routines which terminate currently pending decoder operations
and reset internal state (on the C and Python sides) for instances as
well as sessions. This allows to re-use previously created stacks for
new input data.
|
|
Future implementations might call decoders' start() routine several
times, which makes them call register() again. It's desirable that the
common backend code copes with this condition, such that (the multitude
of) decoder implementations need not work around a specific constraint.
|
|
Have the Python C API check the argument type and do the type conversion
already. Raise an IndexError exception when the range check fails.
|
|
Introduce an oldpins_array_seed() helper routine, to make sure that each
call site which checks previous pin state will find valid data. This was
not always the case after decoder reset, which released the old pin data
while applications would not call srd_inst_new() again.
Preset newly allocated arrays with the default initial pin state, allow
optional application calls to specify differing initial values (when
specified by users), and keep the current state after first data was
processed.
|
|
|
|
The "max7219" decoder used to have no constructor, which made me miss
it when reset() got introduced. Implement those two methods (which do
nothing, and thus won't change behaviour).
|
|
The "microwire" decoder used to have no constructor, which made me miss
it when reset() got introduced. Implement those two methods (which do
nothing, and thus won't change behaviour).
|
|
|
|
As this uses g_slist_copy_deep(), we now require glib 2.34.
|
|
|
|
|
|
|
|
Introduce optional detection of a carrier signal. Immediately "go active"
when edges are seen. "Go inactive" again in the absence of edges in a
specified period of time. Cope with input signals that already had the
carrier removed.
By default carrier detection is disabled, to remain pixel compatible to
the previous implementation. When a carrier frequency is specified and
thus detection is enabled, edges of already filtered input are shifted
by one carrier period, and thus changes the output of the decoder. For
unfiltered inputs that still contain the carrier, detection of activity
is reliable and immediate, but the active phase is extended by one
period of the carrier frequency (which is considered acceptable).
|
|
Users may not know which unit the "wordsize" is supposed to get
specified in. Especially when it's not a number of bits, but instead
the number of bus cycles. Expand the description text accordingly.
|
|
Only emit the speed annotations when a sample rate was specified. Cope
with the absence of a sample rate for the input stream. Decoding is
still possible, it's just that no timing information is available.
|
|
Only emit sound samplerate information when an input stream sample rate
was specified. Cope with the absence of a sample rate for the input
stream. Decoding is still possible, it's just that no timing information
is available.
|
|
Absence of a samplerate for the input stream should not be fatal. The
protocol decodes fine, we just cannot determine a bitrate for frames.
This addresses part of bug 1076.
|
|
Make sure the PKG_PROG_PKG_CONFIG macro has become available before it
gets used. This unbreaks configuration in the poky environment (rocko).
|
|
Improve robustness of some more protocol decoders. Few of them never
checked for the availability of a sample rate in the first place, others
checked for the presence of a spec but would not cope with a value of 0.
Some checked the value only after processing it, which could result in
runtime errors.
This change is motivated by bug #1118.
|
|
The explicit test for None was not good enough. Change test conditions
such that sample rates only get processed when they got specified _and_
were not zero.
This fixes bug #1118.
|
|
Introduce an "audio and modem control for PC systems" protocol decoder
(referred to as AC'97).
This implementation extracts bits and identifies frames, and annotates
the slots of a frame with mere integer values. Bit fields get decoded
depending on the slot numbers. Bit patterns in audio/modem data slots
can get exported as binary streams.
Some TODO items remain. Register access (read/write) gets annotated, but
neither gets interpreted nor affects the decoding of subsequent frames.
The RESET# line status does not get evaluated.
|
|
Nobody has seen any such slave in the wild, yet. In the very unlikely
case that someone actually sees or needs this, patches are welcome
though (together with sample .sr files).
|
|
Allow configuration of the 'reset' signal polarity. Reset counters on
either falling (default) or rising edges.
|
|
Also, add long and short annotation string versions.
|
|
This decoder just counts the number of falling and/or rising edges. This
is especially useful for diagnosing protocols with a clock signal or a
fixed number of transitions per bit, e.g. pulse length coded.
It also provides a divider, which can be used to e.g. count the number
of words in I²C or SPI transfers.
|
|
Print all annotations for individual data bit items and for the
de-multiplexed words in a consistent style with leading zeros and
constant width. This shall lend itself better to quick navigation
during visual inspection, as well as automatic processing.
|
|
The previous implementation prepared but never fully enabled the
accumulation of several multi-bit items into words that span multiple
bus cycles (think: address or data de-multiplexing on memory busses).
Complete the accumulation, and fixup the end samplenumber for word
annotations. Fixup the endianess logic (the condition was inverted).
Rephrase calculation to be more Python idiomatic.
Default to word size zero, and only emit word annotations for non-zero
word size specs. This keeps the implementation backwards compatible and
still passes the test suite. Default behaviour is most appropriate for
interactive use in GUI environments, while automated processing will
find consistent behaviour across all setups (non-multiplexed busses, and
multiplexed busses with "words" that span one or multiple cycles).
|
|
Cope when users only provide e.g. input lines D0 and D2 to the parallel
decoder. Assume that not-connected pins are "always zero".
Rephrase the .decode() logic which determines .wait() conditions while
we are here, to slightly unobfuscate the implementation.
This fixes bug #1088.
|