Age | Commit message (Collapse) | Author |
|
|
|
Introduce options for the initial edge and word counter values. Default
to 0 for compatibility with the previous implementation. This fixes
bug #1229.
|
|
(minor readability / consistency improvement)
|
|
Track the start of a data or word cycle. Avoid narrow ss=es annotations
which may be tedious to inspect by users in GUI applications. This
resolves the issue initially reported in bug #1210.
|
|
Explicitly pass a start sample number to the .putc() method, to prepare
annotations where ss differs from es. This is motivated by bug #1210.
Stick with the narrow ss=es annotations for backwards compatibility.
|
|
Replace str() conversion with explicit number text formatting, for
improved awareness and easier future adjustment during maintenance.
|
|
Since values get accessed within the .decode() method exclusively, we need
not store data in instance variables of the decoder object. Use another
variable for the "reset edge" option as well for consistency.
|
|
Since PD API v3 the .decode() method is called exactly once, and
contains a main loop itself. Move initialization code that sets up
.decode() related logic to the start of the .decode() routine.
|
|
Replace magic numbers by symbolic references to (fixed and optional)
decoder input signals, .wait() conditions, as well as annotation rows.
Move some empty lines, to better reflect which code lines form groups of
similar activity ("blocks" that logically belong together).
|
|
The previous implementation used the fact that libsigrok's internal API
happens to use the first letter of the user visible English option text.
Two locations mapped edge choices to API literals in different ways.
Unify them, introduce an explicit option text to literal value mapping.
(Many if not all decoder implementations do that. More adjustment to use
common code could be beneficial.)
|
|
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.
|