Age | Commit message (Collapse) | Author |
|
The CAN frame's ID field gets stored in an .id member, which is
unfortunate. Use .ident instead. The 'id' identifier is a Python
language word, though it's used for PD boilerplate as well. Assume
that the boilerplate is worth keeping, and harder to adjust (more
dependencies), so adjust this PD's implementation to resolve the
ambiguity.
|
|
Eliminate repeated local string manipulation for the purpose of
number conversion from bits input. Prefer the common helper instead
(is an MSB first variant desirable to simplify call sites more?).
|
|
Adjust nits in the previous commit which added Python output to the CAN
decoder. Rename the routine to .putpy() for consistency with other PDs.
Avoid the 'bytes' identifier as it ships with Python as a data type.
Rephrase the construction of the tuple for Python output, to become more
explicit and help reviewers. Partially "undo" the rtr rename, to reduce
diffs to the previous version (see diff HEAD~2 to see the essence). Fix
up a three space indentation issue (which was there before the addition
of Python output).
|
|
|
|
|
|
|
|
Do more of the calculation with floating point, only trim precision and
enforce integers at the end of the determination of the next sample
point. This shall increase robustness at low capture sample rates.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only add items to 'outputs' if the respective PD actually has
OUTPUT_PYTHON support implemented as of right now.
Various decoders might get OUTPUT_PYTHON support later, but the
'outputs' field should reflect the current status.
|
|
|
|
|
|
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!
|
|
Move initialization code of protocol decoders from the constructor to a
new reset() helper method. The libsigrokdecode backend could run this
method several times to clear the decoder's internal state, before new
data from another acquisition gets fed to decode() calls.
|
|
Check for falling edges (i.e. changes to dominant state) between bits of
a CAN frame, and adjust subsequent bit slots' sample points accordingly.
This is a simple implementation which could get improved later. But it
improves the decoder's reliability when the input signal's rate differs
from the nominal rate.
This fixes bug #990.
Reported-By: PeterMortensen via IRC
|
|
Consistently use .sample_point for the member variable that corresponds
to the 'sample_point' property. Use 'samplenum' in .get_sample_point()
to reflect that the routine returns a sample number. This eliminates the
'bitpos' identifier which was used for two different things.
|
|
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.
|
|
|
|
Remove the FSF postal address as it might change (it did in the past).
Reference the gnu.org website instead which is more stable.
|
|
The previous **kwargs some PDs had is not actually ever used, so drop it.
|
|
|
|
|
|
Anything else in the pd.py files doesn't have to be imported/exposed.
|
|
Drop them from the libsigrokdecode repository.
|
|
|
|
- No newlines at the end of files.
- No trailing ';' characters.
- Comparison with None: Use 'is None' or 'is not None'.
- Comparison with True/False: Use 'if cond:' or 'if not cond:'.
- Various minor whitespace fixes.
|
|
Also, use the "if not self.samplerate" form, which catches both the case
where self.samplerate is None, as well as the case where it is 0.
|
|
In all current PDs it is not necessary to raise an exception upon
invalid states (of the PD's state machine), since we can guarantee that
no such invalid state can ever be reached in these PDs.
|
|
Older libsigrokdecode versions are no longer able to use the current
versions of the PDs (various changes in syntax etc).
|
|
|
|
Variables of type 'struct srd_channel *' are consistently named 'pdch' to
make them easily distinguishable from libsigrok's 'struct sr_channel *'
variables that are consistently named 'ch'.
|
|
|
|
This allows users to set values like 70.5% or such.
|
|
Annotation entries also consist of a tuple, not a list.
|
|
|
|
Each option consists of a dictionary with the following keys:
id The option id, which is passed in when setting a value.
desc A description of the option, suitable for display.
def The default value for this option.
values (optional) If present, a tuple containing values the option
may take. They must be of the same type as the default.
Valid types for the options are UTF-8-encoded strings, integers, and
floating point values.
|
|
The output type is now called OUTPUT_PYTHON, adapt all PDs to that.
|