Age | Commit message (Collapse) | Author |
|
The IRMP core library is not thread safe (known limitation, heritage of
the AVR firmware origin). Add a mutex so that calling applications can
lock IR decoder core instances. Allow Python threading while waiting for
the locks, we can safely assume that this IRMP wrapper is used in the
sigrok context which does require Python for decoders. Add my copyright
for the non-trivial changes.
This implementation uses glib for locking to improve portability, which
already is a dependency of the libsigrokdecode component. This version
uses belt and suspenders by implementing a constructor as well as adding
auto init calls to each of the public API code paths. The client ID is
not an essential requirement, but useful during application maintenance.
|
|
Platform detection in the external IRMP library works best when either
the WIN32 or the unix identifiers are provided, which the sigrokdecode
build environment derives from other identifiers which are more reliably
available.
It turns out that other external dependencies like glib or Python may
provide some of these identifiers, too. Which results in the compiler
warning about symbols' redefinition. Only define derived identifiers
when they haven't been provided yet.
This amends commit ab88bae1c7b9.
|
|
|
|
Replace non-ASCII characters in the FDC keyboard map with their
respective number values, since the character presentation is
non-portable and results in compiler warnings.
A similar change was done in IRMP version 3.2.0 (SVN r192 as of
2020-06-22) which the sigrok project has not caught up with yet.
|
|
Recent upstream IRMP core versions introduced a "release" flag in
addition to the "repeat" flag. Prepare the decoder to present these
flags when libraries should pass them in results.
The flags' being orthogonal slightly complicates the logic which
constructs annotation texts. Do provide text variants for all previously
supported zoom levels, yet try to keep the implementation as simple as
possible: Match list lengths for simplified folding. Always print the
flags field even if none of the flags is active (kind of was done before
this change as well, just not visible). This approach easily accepts
more flags as needed in future versions.
|
|
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
|