Age | Commit message (Collapse) | Author |
|
|
|
Bit stuffing does not apply to the last fields of a frame, specifically
the CRC delimiter, the ACK, and the end-of-frame fields. Adjust the
respective bit handling logic.
This fixes bug #656.
|
|
Don't inspect each individual sample in the Python based PD. Instead use
the backend's query API to detect the start of a frame and to advance to
the sample point position.
|
|
|
|
Replace the hardcoded value with the last cmd used. I'd think the whole
ACMD handling could be simplified if we make further use of this new
variable. But for now, let's keep it simple and make it work.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
Probably a typo, currently 'cmd0' gets pushed out.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
|
|
Use the same scale.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
Instead of only measuring the timing from any edge to any edge, provide
a mode to measure the times from falling->falling and rising->rising
edges. This works better to monitor timing of an IRQ pin for instance,
that drives one direction under hardware, and is only cleared by
software reading a value.
Include time delta measurements as an optional annotation to help track
jitter in measurements.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
The extra row of the average isn't always useful. Allow it to be
disabled by setting the average window to zero.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
There are multiple devices in the ADE77xx series that are similar enough
to be supportable via this decoder in the future.
|
|
|
|
No value decoding, that can be fairly complicated.
Signed-off-by: Karl Palsson <karlp@etactica.com>
|
|
putr2 is unused, so let it go.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
|
|
(for consistency with all other decoders)
|
|
|
|
|
|
This fixes parts of bug #931.
|
|
|
|
This has two advantages:
- The Python output is always deterministic, which was not the case for
the dict-based version since dict items have no guaranteed order in
Python. This caused issues with the sigrok-test use-case.
- The code is slightly more readable.
|
|
|
|
|
|
|
|
|
|
This fixes parts of bug #931.
|
|
Now that self.arg is populated, we can finally use it.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
This is especially useful with the default handler, so you can better
understand the transfer if you are already familiar with CMD numbers and
their arguments. It makes it also easier to compare with the debug
output of the e.g. Linux Kernel.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
There is no handler for CMD4 yet.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
|
|
|
This avoids some boilerplate in the decode() method itself.
|
|
Rewrite of the 1-Wire link decoder.
Existing outputs are kept and new warnings are added.
Instead of sampling at fixed user defined time, time ranges as
specified by the "Book of iButton Standards" are used.
The user does not have to tweak the timing values anymore.
Overdrive speed is detected automatically.
This fixes bugs #666 and #926.
|
|
|
|
Some Python versions will lead to the following message on stdout currently:
srd: Attribute Error: Failed to load decoder common: no 'Decoder' \
attribute in imported module: 'module' object has no attribute 'Decoder'
This is a harmless (though confusing for users) warning, since "common"
is not an actual PD and it shouldn't be loaded as PD (it just has to
be present).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Slightly rearrange some of the methods which are involved in UART frame
inspection. Use a consistent sequence of steps: Grab the signal's
current value, accumulate and process the information, emit respective
annotations, and advance to the next stage in the UART frame inspection.
|
|
After the decode() method got adjusted to call wait() with custom made
conditions and to check .matched[] before inspecting samples, the check
whether a bit time's sample point was reached has become obsolete.
|
|
Since either of the UART signals (RX, TX) is optional, and in the
absence of Decoder.wait() conditions that "will never match", we cannot
construct a constant layout. Instead we need to explicitly keep track of
which item in the list of wait conditions corresponds to which signal.
Once the index in the list of wait conditions is known, inspection of
samples can depend on the Decoder.matched[] attribute. Before this
change, redundant reached_bit() checks kept us from processing samples
that should not have been inspected. Tests pass before and after this
very commit.
|
|
Factor out the logic which inspects samples that were provided by the
PD version 3 query API, and dispatches their processing depending on
the progress of UART frame inspection. "Unroll" a loop over the RX and
TX signals.
This commit replaces some complicated variable assignments by easier to
verify invocations.
|
|
Adjust the UART protocol decoder, to make use of the query based API.
Have edges detected and unrelated samples skipped by common code.
This implementation keeps some redundancy in place (like checking for
having reached specific sample numbers, while the backend managed that
for us). This approach reduces the diff and shall simplify review.
Only some common checks in decode() were moved to the start of the
routine, outside of the sample inspection loop.
|
|
Rephrase the bit slot index calculation for UART frames such that it
becomes more apparent whether a start bit is involved or whether an
array index needs adjustment due to Python range semantics.
This shall improve readability, and reduce the probability of off-by-one
errors during maintenance.
|
|
When the UART frame does not contain a parity bit, then immediately
advance to reception of stop bits after all data bits were received.
This eliminates the necessity to run the parity check routine when
parity does not apply in the first place. Without this change, some
"dummy" sample needs to get inspected for correct operation of the
state machine.
|
|
|
|
Add support to terminate blocking .wait() and .decode() method calls of
v3 decoder instances. This terminates the decoder thread's main routine
and allows to release associated resources. Cope with requested as well
as unexpected termination of decode() calls. Add debug messages to
thread related code paths.
Make sure to unblock the main thread which feeds the decoder thread.
This unbreaks situations where decoders e.g. throw "need samplerate to
decode" exceptions.
Drain Python errors which might remain from the most recent .decode()
execution, to not affect other code paths. This avoids an issue where
the creation of a new decoder instance fails in the presence of errors
from a previous run.
This fixes bug #902.
|