Age | Commit message (Collapse) | Author |
|
The upstream IRMP project builds fine with direct gcc(1) invocation.
While the same imported source fails detection and then defaults to AVR
when built under libtool in the libsigrokdecode setup.
Provide the symbols which IRMP logic expects, to reduce changes against
upstream sources. Derive these symbols from conditions that are checked
in the sigrok project in other locations, too.
|
|
Workaround the default verbosity level of the IRMP core logic for
PC library build configurations. Silence the ANALYZE related output.
|
|
Address several style nits in the previous implementation of the PC
library, but keep the core as is to simplify future upstream tracking.
Eliminate camel case identifiers, and in(?)/out prefixes for variables,
only keep s_ for global(?) variables. Fixup whitespace, reduce a little
indentation where appropriate. Separate variable declaration from later
assignments and updates to improve readability. Use C style comments.
Drop initializer values for .bss variables. Decorate the declaration as
well as implementation of routines for symbol export. Improve robustness
of name lookups in the list of known protocols.
Prefer native C language data types in the public API. Normalize data in
the wrapper so that application code need not care. Make the byte buffer
API for IR frame detection optional. The API is limited and overloaded
at the same time, and may need more consideration.
Extend comments in spots which are essential for proper operation, or
which encode non-obvious details of the build system. Control visibility
of public API identifiers on non-Windows platforms, too. Rephrase the
doxygen comments for more formal API documentation. Discuss limitations
in the current implementation. Keep a TODO list in the source code.
|
|
Introduce sources which implement a shared object (DLL) which embeds the
IRMP core logic, receives pin values from an application, and makes IR
detection from previously captured data available in PC environments as
a library, in contrast to the text oriented desktop applications and the
MCU firmware which existed before in the upstream project.
Provided by: Rene Staffen
|
|
Introduce variables in the IRMP core logic which track the current
sample number, and the position where the start of an IR frame got
detected. The variables are conditional (ANALYZE builds only).
Provided by: Rene Staffen
Local modification: Drop the initializer for the static variables.
They reside in .bss and need not occupy .data space.
|
|
This change enables most IR protocol variants (35 of them), as well as
32bit wide counters, and uses the highest supported samplerate of 20kHz
by default. Which shall result in most reliable detection of protocols
and an appropriate feature set for PC library use.
Provided by: Rene Staffen
|
|
The sigrok project enforces warnings when public routines of compile
units lack prototypes. Add a prototype for the irmp.c:print_spectrum()
routine to silence a compiler warning. An alternative would have been to
mark the routine as static (it's exclusively used within the same file).
|
|
The #else inside a multi line comment in combination with the excess yet
commented #endif threw off my editor's syntax highlighting and parentheses
matching. Use "#if 0" instead to disable the empty side of ANALYZE macros
which some PIC compilers are said to not support. No change in behaviour.
|
|
Assume that IR command codes can get represented by a C language 'int'
data type. The other value in the comparison is another 'int' anyway.
|
|
Pick low hanging fruit. Stick with the previous implementation's format
specifiers, assume that they work on all platforms which IRMP supports.
Cast arguments to mere integers where necessary instead, again assume
that their range fits as they did in the previous implementation. This
silences several of these compiler warnings:
irmp.c:3332:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
^
|
|
Introduce a separate README-sigrok.txt file, to leave the upstream
project's README.txt file as is. Mention that libsigrokdecode only
contains a subset of the full IRMP project source code.
|
|
Introduce source files and documentation from the GPL'ed IRMP project.
Commit those files which represent the IRMP core logic (detection of
IR frames), and reference the project's homepage for the remainder.
These files correspond to
svn://mikrocontroller.net/irmp r191
|
|
This is inspired by the autobook sections on Windows DLL builds.
https://www.sourceware.org/autobook/autobook/autobook_137.html
The AC_C_CONST macro improves support for the C language 'const'
decoration in case the compiler does not understand it.
|
|
|
|
The PJDL decoder's previous implementation was incomplete. It assumed
that PAD bits always start with a rising edge. Which made the decoder
miss the next byte when a previous byte's MSB is set, and the last DATA
bit and the next PAD bit kept the signal HIGH between them (no LOW phase
was seen between these symbols).
Keep the check for the LOW level after the byte's last DATA bit within
the bit times' tolerance. But accept when the level remains HIGH, and
check for the HIGH bit's width starting from the end of the last DATA
bit. Also start the PAD bit's annotation from that "virtual" edge.
This patch is based on a fix that was
Submitted-By: Julio Aguirre <jcallano@gmail.com>
|
|
The previous implementation unconditionally assumed a CRC width of
one byte when it calculated the checksum for received frame data.
Do reflect on the CRC8/CRC32 choice instead.
This patch is based on a fix that was
Submitted-By: Julio Aguirre <jcallano@gmail.com>
|
|
|
|
|
|
|
|
|
|
Optionally let users pick the scale for terse timing annotation text.
Which potentially makes numbers show up earlier (at zoom levels of a
further distance). And drops the unit to present mere numbers, which
could speed up navigation during inspection. Keep providing automatic
scaling which then includes the unit text, as it did before.
Extend the automatic scaling to include picoseconds. Which avoids the
fallback to unit-less floating point with uncertain decimals when the
samplerate was 1GHz or higher.
Optionally present distances in terms of sample counts. This supports
decoder development, and can help users spot and judge glitches.
All "terse" presentation so far exclusively affects the 'time' row. It
remains an option for later to migrate averages and deltas as well. For
now it's assumed that high(er) precision and fine grained details are
more important for these rows.
|
|
Break text lines in the options declarations which have become rather
long. Rename 'samples' in the main loop to just 'sa', which better
matches the other 'ss', 'es', 't', etc identifers. Separate the code
for unconditional 'time' classes from optional averaging and deltas.
|
|
Reduce the amount of work which the timing decoder needs to do. Only
keep the deque() filled when averaging is active. Rephrase .put() calls
to reduce text line lengths (and for consistency with a pending change).
Move another options lookup for deltas out of the main loop.
|
|
In some situations (inspecting a dense run of pulses in a burst of data
communication) it takes a lot of zooming before the 'timing' decoder's
'time' annotations start revealing numbers. Which limits the number of
pulses which can fit in the visible trace area.
This is a stab at improving the usability of the timing decoder for
similar "crowded pulses" scenarios. Try to come up with an annotation
text that is shorter yet communicates the very details which the user
needs in this situation. Drop the frequency, avoid umlauts in the unit
text, don't use decimal places (use all integers within a scale). Even
offer to drop the unit text, assuming that a dense run of pulses results
in all times sharing their scale.
Make the terse presentation optional and off by default, and use a
separate annotation class for maximum backwards compatibility.
|
|
Consistently use ss and es identifiers for annotation emission to match
other decoders, as well as counting distances between sample points to
increase readability. This also dramatically reduces text line length.
|
|
Reduce the number of self members, use local variables instead for data
which is strictly kept within a method and need not remain across calls.
Move options dictionary lookups out of the main loop, as the previous
implementation already did with 'edge'.
|
|
Use symbolic identifiers for pin numbers and annotation classes. Remove
unused variables.
|
|
|
|
The SAE J1850 Variable Pulse Width decoder used to track and annotate
the width of pulses between edges, which duplicates existing features
of the 'timing' decoder. Remove this part from J1850, users can always
connect the input signal to multiple decoders as needed..
Also sort annotation rows while we are here. Top to bottom represents
raw wire bits to highest interpretation layer, as in other decoders.
|
|
Use symbolic identifiers for annotation classes, to improve readability
and maintainability.
|
|
IRC user pman92 reported that this decoder exists, and started migration
to the v3 API. This commit completes the migration, and adds missing
decoder infrastructure which has become mandatory recently.
Adjust the boilerplate: Drop FSF postal address. No Python output, add
category tag, unambiguous annotation class and row names. Add reset()
method. Use common code for edge detection.
This commit also addresses minor style nits. Pass the most recent
pulse's edges as ss and es to the data bit handling routine. Adjust
whitespace to unbreak editor navigation and to improve readability.
Use a more verbose name for the decoder, "vpw" appears a little short
and collision happy, and is not found when users search for "j1850".
[ Indentation changed, see whitespace ignoring diff for the essence. ]
Reported-By: pman92 <dpriestley92@hotmail.com>
|
|
Introduce a protocol decoder for the GM VPW 1x and 4x Vehicle Bus
(SAE J1850, or VPW for variable pulse width).
|
|
Do track the RX and TX information, including their bus IDs. Present bus
numbers as dotted quads. Emit another summary annotation for completed
frames which presents receiver, transmitter, payload, and ACK details at
even higher zoom levels. Rename the last remaining "init CRC" instance
for consistency.
|
|
Since the spec is vague on the subject, and real world captures were
found to occassionally run on odd clocks, internally prepare to inspect
traffic and interpret its content although the input data is invalid in
the strictest sense. Keep this hack internal, don't suggest to users
that invalid traffic would be perfectly acceptable.
|
|
Rename 'pjon-link' to 'pjon_link' for consistency with other decoders.
|
|
Introduce a protocol decoder which accepts 'pjon-link' Python input and
interprets PJON frames. The implementation is assumed to be operational
but most of the protocol's flexibility (optionally present and variable
width fields) has not yet been tested due to lack of example captures.
During development of the PJON decoder only the PJDL link layer decoder
was available, other link layers were not tested.
|
|
Introduce a protocol decoder which generates 'pjon-link' output from
'logic' input by interpreting the PJDL single wire serial communication
link layer of the PJON protocol stack. This decoder extracts frame
markers, data bytes, as well as their pad/sync decoration. Inspection of
data values, or checks for frame validity remain the responsibility of a
stacked decoder which is shared among several link layer types.
This implementation "violates" the PJDL spec in those places where the
spec is incomplete or vague, and real world traffic would not decode at
all when the strict letter of the spec is applied instead of its spirit.
When in doubt, the decoder implementation errs to the usability side.
Carrier sense detection is incomplete in this version. Data extraction
works for all currently available captures. Recovery from synchronization
loss after glitches is acceptable. Glitch filtering is missing (the spec
is silent on this subject).
|
|
Improve processing time by appending bits
instead of inserting them to the lists.
|
|
|
|
Drop the 0x prefix for each byte in annotations (for improved readability).
Also, use 02X instead of 02x (printf-style formats).
|
|
If those are useful for the decoder user, they should be annotations
using the Ann.WARN annotation class.
|
|
|
|
|
|
|
|
|
|
|
|
There were a few places where PyLong_FromLong() was used for uint64_t
numbers. Properly use PyLong_FromUnsignedLongLong() there, and also
fix a few additional size/signedness issues while we're here.
Reported (and partial patch provided) by "The Count" on Bugzilla, thanks!
This fixes bug #1499.
|
|
type_decoder.c:1040:16: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
1040 | { "register", (PyCFunction)Decoder_register, METH_VARARGS|METH_KEYWORDS,
| ^
|
|
On the Data row, the content of the single-byte registers is decoded as
follows: '<Meaning> <Value> <Unit>'. Initially, the meaning for these
registers was misplaced. This commit updates these meanings as they
really are.
Signed-off-by: Teo Perisanu <Teo.Perisanu@analog.com>
|
|
|