]> sigrok.org Git - libsigrokdecode.git/log
libsigrokdecode.git
5 years agospiflash: Add basic Adesto AT45DBxx support (WRITE1/2, STATUS).
Aleksander Alekseev [Thu, 3 May 2018 12:04:47 +0000 (14:04 +0200)]
spiflash: Add basic Adesto AT45DBxx support (WRITE1/2, STATUS).

5 years agodcf77: annotate unexpected bit numbers and values, do not abort execution
Gerhard Sittig [Mon, 16 Apr 2018 19:15:13 +0000 (21:15 +0200)]
dcf77: annotate unexpected bit numbers and values, do not abort execution

Improve robustness of the DCF77 decoder. Cope with "neiter 0 nor 1" bit
values (glitches can break the detection of pulse widths), as well as
unexpected bit numbers (more than 59 pulses per minute, can be a
follow-up error after e.g. glitches break one long pulse into two short
pulses). Do not process this invalid data, do emit error annotations.

5 years agodcf77: annotate invalid dow and month fields, do not abort execution
Gerhard Sittig [Sun, 22 Apr 2018 08:07:07 +0000 (10:07 +0200)]
dcf77: annotate invalid dow and month fields, do not abort execution

Emit error annotations for invalid day of the week or month numbers,
instead of aborting decoder execution with an exception.

Implementation detail: Neither the Python 'in' keyword nor a .get()
method are available. That's why we have to catch the IndexError
exception.

This fixes bug #1173.

5 years agodcf77, lpc: rephrase bit string formatting
Gerhard Sittig [Mon, 16 Apr 2018 19:12:16 +0000 (21:12 +0200)]
dcf77, lpc: rephrase bit string formatting

Create the text representation of a bit string by means of the builtin
.format() method and an appropriate specifier. Drop the non-obvious
sequence of bin() and slice and zfill() calls.

5 years agoinstance: return SRD_ERR_TERM_REQ when execution shall terminate
Gerhard Sittig [Mon, 23 Apr 2018 18:42:54 +0000 (20:42 +0200)]
instance: return SRD_ERR_TERM_REQ when execution shall terminate

The previous implementation internally noticed the "want terminate"
request, and skipped decoder execution to faster get to the end of the
input stream. But an OK return code was provided in that code path, and
more input data was sent by applications (sometimes for many seconds or
few minutes).

Do return a new SRD_ERR_TERM_REQ error code, such that applications can
tell failed execution from requested termination.

5 years agoinstance: drop an unneeded "want wait() to terminate" reset assignment
Gerhard Sittig [Mon, 23 Apr 2018 18:40:28 +0000 (20:40 +0200)]
instance: drop an unneeded "want wait() to terminate" reset assignment

It's uncertain why srd_inst_decode() which internally gets called by the
public srd_session_send() routine used to clear the want_wait_terminate
flag. This should be cleared upon decoder instance creation and state
reset, gets raised upon termination request, but shall not get cleared
in other spots, especially not upon the availability of new input data
while the stream shall be considered in the "about to terminate, skip
all subsequent execution" state.

5 years agolog: Move log level check so that it affects all handlers.
Uwe Hermann [Sat, 21 Apr 2018 22:17:49 +0000 (00:17 +0200)]
log: Move log level check so that it affects all handlers.

Before this change, the loglevel check would only be performed for the
default log handler in libsigrokdecode, but not for other handlers set
via srd_log_callback_set().

This fixes bug #698.

5 years agosrd_exception_catch(): Beautify traceback logging output.
Uwe Hermann [Fri, 20 Apr 2018 21:30:58 +0000 (23:30 +0200)]
srd_exception_catch(): Beautify traceback logging output.

5 years agoDecoder_register(): Drop an overly verbose log message.
Uwe Hermann [Fri, 20 Apr 2018 19:46:59 +0000 (21:46 +0200)]
Decoder_register(): Drop an overly verbose log message.

5 years agosrd_logv(): Add an explicit fflush().
Uwe Hermann [Fri, 20 Apr 2018 19:45:04 +0000 (21:45 +0200)]
srd_logv(): Add an explicit fflush().

5 years agoShow backtrace when decode() aborts due to an error.
Uwe Hermann [Fri, 20 Apr 2018 19:40:12 +0000 (21:40 +0200)]
Show backtrace when decode() aborts due to an error.

The backtrace printing was actually already there, but was emitted using
sr_dbg(), which doesn't show up by default for most users. Make it an
srd_err() so that most users will see it.

This fixes bug #1158.

6 years agocan: Fix incorrect stuff bit handling.
Uwe Hermann [Thu, 12 Apr 2018 07:02:38 +0000 (09:02 +0200)]
can: Fix incorrect stuff bit handling.

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!

6 years agoDrop overly verbose log messages about (un)loading PDs.
Uwe Hermann [Sun, 8 Apr 2018 17:53:56 +0000 (19:53 +0200)]
Drop overly verbose log messages about (un)loading PDs.

6 years agosda2506/qi: Add missing full stop in 'desc' field.
Uwe Hermann [Sun, 8 Apr 2018 17:29:14 +0000 (19:29 +0200)]
sda2506/qi: Add missing full stop in 'desc' field.

6 years agorc_encode: Use different annotation classes for code word addr/data.
Uwe Hermann [Sun, 8 Apr 2018 17:08:39 +0000 (19:08 +0200)]
rc_encode: Use different annotation classes for code word addr/data.

6 years agorc_encode: Use different annotation classes for different bits.
Uwe Hermann [Sun, 8 Apr 2018 17:02:35 +0000 (19:02 +0200)]
rc_encode: Use different annotation classes for different bits.

6 years agorc_encode: Add self.putx() helper.
Uwe Hermann [Sun, 8 Apr 2018 16:55:08 +0000 (18:55 +0200)]
rc_encode: Add self.putx() helper.

6 years agorc_encode: Use common self.ss/self.es naming.
Uwe Hermann [Sun, 8 Apr 2018 16:47:10 +0000 (18:47 +0200)]
rc_encode: Use common self.ss/self.es naming.

6 years agorc_encode: Use += operator where possible.
Uwe Hermann [Sun, 8 Apr 2018 16:44:09 +0000 (18:44 +0200)]
rc_encode: Use += operator where possible.

6 years agorc_encode: Drop unneeded casts.
Uwe Hermann [Sun, 8 Apr 2018 16:41:59 +0000 (18:41 +0200)]
rc_encode: Drop unneeded casts.

6 years agoAdd initial rc_encode protocol decoder.
steversig [Mon, 2 Apr 2018 17:12:16 +0000 (18:12 +0100)]
Add initial rc_encode protocol decoder.

6 years agotest: add simple "no data" test case for decoder "terminate and reset"
Gerhard Sittig [Sun, 17 Dec 2017 21:24:10 +0000 (22:24 +0100)]
test: add simple "no data" test case for decoder "terminate and reset"

Introduce a "reset" group of tests. Whip up a first test step which runs
the "terminate and reset" routine for decoder stacks after session
creation, start, and meta data setup. No input data gets processed, no
decoder output is tested yet.

6 years agosession: add "terminate and reset" support for protocol stacks
Gerhard Sittig [Sun, 17 Dec 2017 17:55:46 +0000 (18:55 +0100)]
session: add "terminate and reset" support for protocol stacks

Implement routines which terminate currently pending decoder operations
and reset internal state (on the C and Python sides) for instances as
well as sessions. This allows to re-use previously created stacks for
new input data.

6 years agoDecoder: check for duplicate register() calls in common backend code
Gerhard Sittig [Fri, 26 Jan 2018 20:02:25 +0000 (21:02 +0100)]
Decoder: check for duplicate register() calls in common backend code

Future implementations might call decoders' start() routine several
times, which makes them call register() again. It's desirable that the
common backend code copes with this condition, such that (the multitude
of) decoder implementations need not work around a specific constraint.

6 years agodecoder: rephrase .has_channel() argument parse logic
Gerhard Sittig [Sun, 17 Dec 2017 17:50:25 +0000 (18:50 +0100)]
decoder: rephrase .has_channel() argument parse logic

Have the Python C API check the argument type and do the type conversion
already. Raise an IndexError exception when the range check fails.

6 years agoinstance: make sure oldpins array is available after reset
Gerhard Sittig [Sun, 4 Feb 2018 18:12:48 +0000 (19:12 +0100)]
instance: make sure oldpins array is available after reset

Introduce an oldpins_array_seed() helper routine, to make sure that each
call site which checks previous pin state will find valid data. This was
not always the case after decoder reset, which released the old pin data
while applications would not call srd_inst_new() again.

Preset newly allocated arrays with the default initial pin state, allow
optional application calls to specify differing initial values (when
specified by users), and keep the current state after first data was
processed.

6 years agoadns5020: Python style nit, fixup whitespace
Gerhard Sittig [Sat, 13 Jan 2018 18:51:07 +0000 (19:51 +0100)]
adns5020: Python style nit, fixup whitespace

6 years agomax7219: introduce constructor and reset() method
Gerhard Sittig [Sun, 28 Jan 2018 21:59:59 +0000 (22:59 +0100)]
max7219: introduce constructor and reset() method

The "max7219" decoder used to have no constructor, which made me miss
it when reset() got introduced. Implement those two methods (which do
nothing, and thus won't change behaviour).

6 years agomicrowire: introduce constructor and reset() method
Gerhard Sittig [Sat, 13 Jan 2018 18:30:53 +0000 (19:30 +0100)]
microwire: introduce constructor and reset() method

The "microwire" decoder used to have no constructor, which made me miss
it when reset() got introduced. Implement those two methods (which do
nothing, and thus won't change behaviour).

6 years agoprint_searchpaths(): Print decoder and system search paths.
Uwe Hermann [Sun, 18 Mar 2018 16:54:11 +0000 (17:54 +0100)]
print_searchpaths(): Print decoder and system search paths.

6 years agoFix part of #1128 by adding a way to retrieve PD search paths
Soeren Apel [Sat, 17 Mar 2018 20:40:36 +0000 (21:40 +0100)]
Fix part of #1128 by adding a way to retrieve PD search paths

As this uses g_slist_copy_deep(), we now require glib 2.34.

6 years agoAdd support for SDA2506 EEPROM serial protocol.
Max Weller [Tue, 30 Jan 2018 22:22:06 +0000 (23:22 +0100)]
Add support for SDA2506 EEPROM serial protocol.

6 years agoMinor whitespace/typo fixes.
Uwe Hermann [Tue, 6 Mar 2018 22:55:34 +0000 (23:55 +0100)]
Minor whitespace/typo fixes.

6 years agodali: Avoid CamelCase in most places.
Uwe Hermann [Fri, 23 Feb 2018 15:57:22 +0000 (16:57 +0100)]
dali: Avoid CamelCase in most places.

6 years agoir_nec: optionally accept input signals that include the carrier
Gerhard Sittig [Sat, 2 Sep 2017 10:52:32 +0000 (12:52 +0200)]
ir_nec: optionally accept input signals that include the carrier

Introduce optional detection of a carrier signal. Immediately "go active"
when edges are seen. "Go inactive" again in the absence of edges in a
specified period of time. Cope with input signals that already had the
carrier removed.

By default carrier detection is disabled, to remain pixel compatible to
the previous implementation. When a carrier frequency is specified and
thus detection is enabled, edges of already filtered input are shifted
by one carrier period, and thus changes the output of the decoder. For
unfiltered inputs that still contain the carrier, detection of activity
is reliable and immediate, but the active phase is extended by one
period of the carrier frequency (which is considered acceptable).

6 years agoparallel: expand 'wordsize' description (bits vs cycles)
Gerhard Sittig [Thu, 28 Dec 2017 17:08:51 +0000 (18:08 +0100)]
parallel: expand 'wordsize' description (bits vs cycles)

Users may not know which unit the "wordsize" is supposed to get
specified in. Especially when it's not a number of bits, but instead
the number of bus cycles. Expand the description text accordingly.

6 years agostepper_motor: make samplerate meta data optional
Gerhard Sittig [Sun, 17 Dec 2017 22:59:16 +0000 (23:59 +0100)]
stepper_motor: make samplerate meta data optional

Only emit the speed annotations when a sample rate was specified. Cope
with the absence of a sample rate for the input stream. Decoding is
still possible, it's just that no timing information is available.

6 years agoi2s: make samplerate meta data optional
Gerhard Sittig [Sun, 17 Dec 2017 23:05:40 +0000 (00:05 +0100)]
i2s: make samplerate meta data optional

Only emit sound samplerate information when an input stream sample rate
was specified. Cope with the absence of a sample rate for the input
stream. Decoding is still possible, it's just that no timing information
is available.

6 years agoi2c: make input samplerate optional
Gerhard Sittig [Fri, 15 Dec 2017 18:26:29 +0000 (19:26 +0100)]
i2c: make input samplerate optional

Absence of a samplerate for the input stream should not be fatal. The
protocol decodes fine, we just cannot determine a bitrate for frames.

This addresses part of bug 1076.

6 years agoconfigure.ac: explicitly require pkg-config related macro
Gerhard Sittig [Sat, 10 Feb 2018 11:24:17 +0000 (12:24 +0100)]
configure.ac: explicitly require pkg-config related macro

Make sure the PKG_PROG_PKG_CONFIG macro has become available before it
gets used. This unbreaks configuration in the poky environment (rocko).

6 years agograycode, morse, pwm, usb_request, wiegand: cope with absent sample rate
Gerhard Sittig [Sun, 28 Jan 2018 19:49:48 +0000 (20:49 +0100)]
graycode, morse, pwm, usb_request, wiegand: cope with absent sample rate

Improve robustness of some more protocol decoders. Few of them never
checked for the availability of a sample rate in the first place, others
checked for the presence of a spec but would not cope with a value of 0.
Some checked the value only after processing it, which could result in
runtime errors.

This change is motivated by bug #1118.

6 years agospi: cope when a sample rate of 0 was configured
Gerhard Sittig [Sun, 28 Jan 2018 19:02:09 +0000 (20:02 +0100)]
spi: cope when a sample rate of 0 was configured

The explicit test for None was not good enough. Change test conditions
such that sample rates only get processed when they got specified _and_
were not zero.

This fixes bug #1118.

6 years agoac97: introduce first AC'97 decoder implementation (bits, slots, binary)
Gerhard Sittig [Sat, 2 Sep 2017 16:48:03 +0000 (18:48 +0200)]
ac97: introduce first AC'97 decoder implementation (bits, slots, binary)

Introduce an "audio and modem control for PC systems" protocol decoder
(referred to as AC'97).

This implementation extracts bits and identifies frames, and annotates
the slots of a frame with mere integer values. Bit fields get decoded
depending on the slot numbers. Bit patterns in audio/modem data slots
can get exported as binary streams.

Some TODO items remain. Register access (read/write) gets annotated, but
neither gets interpreted nor affects the decoding of subsequent frames.
The RESET# line status does not get evaluated.

6 years agoi2c: Drop obsolete 10bit slave address TODO.
Uwe Hermann [Sat, 13 Jan 2018 17:07:57 +0000 (18:07 +0100)]
i2c: Drop obsolete 10bit slave address TODO.

Nobody has seen any such slave in the wild, yet. In the very unlikely
case that someone actually sees or needs this, patches are welcome
though (together with sample .sr files).

6 years agocounter: make 'reset' signal polarity an option
Gerhard Sittig [Wed, 3 Jan 2018 18:41:37 +0000 (19:41 +0100)]
counter: make 'reset' signal polarity an option

Allow configuration of the 'reset' signal polarity. Reset counters on
either falling (default) or rising edges.

6 years agocounter: Make "word reset" an explicit annotation class+row.
Uwe Hermann [Wed, 3 Jan 2018 16:20:49 +0000 (17:20 +0100)]
counter: Make "word reset" an explicit annotation class+row.

Also, add long and short annotation string versions.

6 years agoAdd a trivial "counter" decoder
Stefan Brüns [Tue, 2 Jan 2018 01:17:07 +0000 (02:17 +0100)]
Add a trivial "counter" decoder

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.

6 years agoparallel: implement consistent number formatting
Gerhard Sittig [Fri, 22 Dec 2017 20:07:28 +0000 (21:07 +0100)]
parallel: implement consistent number formatting

Print all annotations for individual data bit items and for the
de-multiplexed words in a consistent style with leading zeros and
constant width. This shall lend itself better to quick navigation
during visual inspection, as well as automatic processing.

6 years agoparallel: unbreak and improve "word" de-multiplexing
Gerhard Sittig [Fri, 22 Dec 2017 14:16:27 +0000 (15:16 +0100)]
parallel: unbreak and improve "word" de-multiplexing

The previous implementation prepared but never fully enabled the
accumulation of several multi-bit items into words that span multiple
bus cycles (think: address or data de-multiplexing on memory busses).

Complete the accumulation, and fixup the end samplenumber for word
annotations. Fixup the endianess logic (the condition was inverted).
Rephrase calculation to be more Python idiomatic.

Default to word size zero, and only emit word annotations for non-zero
word size specs. This keeps the implementation backwards compatible and
still passes the test suite. Default behaviour is most appropriate for
interactive use in GUI environments, while automated processing will
find consistent behaviour across all setups (non-multiplexed busses, and
multiplexed busses with "words" that span one or multiple cycles).

6 years agoparallel: cope with sparse input mappings, assume zero for not-connected pins
Gerhard Sittig [Fri, 22 Dec 2017 13:48:37 +0000 (14:48 +0100)]
parallel: cope with sparse input mappings, assume zero for not-connected pins

Cope when users only provide e.g. input lines D0 and D2 to the parallel
decoder. Assume that not-connected pins are "always zero".

Rephrase the .decode() logic which determines .wait() conditions while
we are here, to slightly unobfuscate the implementation.

This fixes bug #1088.

6 years agoparallel: address minor style nits, no change in behaviour
Gerhard Sittig [Fri, 22 Dec 2017 14:12:07 +0000 (15:12 +0100)]
parallel: address minor style nits, no change in behaviour

Remove the redundant .itemcount variable, which exactly corresponds to
the length of the .items array.

Arrange retrieval of options and their evaluation closer to each other
for improved readability.

Use common logic to construct "words" from several multi-bit "items".
Arrange for endianess support by optionally reversing the array before
traversal.

6 years agoparallel: unify decode() code paths with and without clock signal
Gerhard Sittig [Fri, 22 Dec 2017 12:55:45 +0000 (13:55 +0100)]
parallel: unify decode() code paths with and without clock signal

Instead of implementing two main loops for operation in the presence and
in the absence of a clock line, use a common main loop which operates on
pre-determined wait conditions.

6 years agousb_power_delivery: enforce check order for start-of-packet sequences
Gerhard Sittig [Fri, 22 Dec 2017 17:51:00 +0000 (18:51 +0100)]
usb_power_delivery: enforce check order for start-of-packet sequences

The list of a dictionary's keys need not reproduce in identical order
everywhere. Make sure to run all start-of-packet sequence checks in the
decoder implementation in a specific order on each machine, such that
annotations get emitted with identical content and in the same order for
each execution of the decoder.

This fixes the remaining part of bug #1090.

6 years agousb_power_delivery: fixup a Python style nit (dict lookup fallback)
Gerhard Sittig [Fri, 22 Dec 2017 17:37:29 +0000 (18:37 +0100)]
usb_power_delivery: fixup a Python style nit (dict lookup fallback)

Use the dictionary's .get() method in combination with a default result
parameter, instead of an explicit "k in dictvar" test and a conditional
assignment.

6 years agousb_power_delivery: enforce numerical order of RDO/PDO flag annotations
Gerhard Sittig [Fri, 22 Dec 2017 17:33:58 +0000 (18:33 +0100)]
usb_power_delivery: enforce numerical order of RDO/PDO flag annotations

Annotations of the USB power delivery decoder contain multiple text
fragments that correspond to several flags in bit fields. The Python
runtime did not guarantee an order of emission and made the test suite
fail.

Sort the order in which RDO and PDO flags related text fragments get
constructed and concatenated. Print text for higher bit positions first
as this might feel more intuitive to users.

This fixes part of bug #1090.

6 years agoall decoders: introduce a reset() method
Gerhard Sittig [Mon, 20 Feb 2017 20:37:05 +0000 (21:37 +0100)]
all decoders: introduce a reset() method

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.

6 years agossi32: rename reset() helper method
Gerhard Sittig [Fri, 22 Dec 2017 02:55:16 +0000 (03:55 +0100)]
ssi32: rename reset() helper method

The ssi32 decoder implements a reset() method which clears internally
accumulated data during decoding. Rename the method before all decoders
will grow a new reset() method that will be used for a different purpose.

6 years agomrf24j40: rename reset() helper method
Gerhard Sittig [Fri, 22 Dec 2017 02:54:21 +0000 (03:54 +0100)]
mrf24j40: rename reset() helper method

The mrf24j40 decoder implements a reset() method which clears internally
accumulated data during decoding. Rename the method before all decoders
will grow a new reset() method that will be used for a different purpose.

6 years agoade77xx: rename reset() helper method
Gerhard Sittig [Fri, 22 Dec 2017 02:51:20 +0000 (03:51 +0100)]
ade77xx: rename reset() helper method

The ade77xx decoder implements a reset() method which clears internally
accumulated data during decoding. Rename the method before all decoders
will grow a new reset() method that will be used for a different purpose.

6 years agosdcard_sd: remove unused .reset() method
Gerhard Sittig [Fri, 22 Dec 2017 01:35:12 +0000 (02:35 +0100)]
sdcard_sd: remove unused .reset() method

The decoder's .reset() method seems to partially implement constructor's
assignments, but is not referenced anywhere. There is neither a direct
call site in the remainder of pd.py which uses the "reset" name, and
runtime computation only references "handle_*()" methods for commands
and responses.

Drop the unused .reset() method in the individual decoder before the
introduction of a common .reset() method approach for all decoders.

6 years agoam230x: rename reset() helper method
Gerhard Sittig [Mon, 20 Feb 2017 19:58:09 +0000 (20:58 +0100)]
am230x: rename reset() helper method

The am230x decoder implements a reset() method which clears internal
decoder state. Rename the method before all decoders will grow a new
reset() method that will be used for a different purpose.

6 years agoeeprom 24xx: rename reset() helper method
Gerhard Sittig [Mon, 20 Feb 2017 20:09:07 +0000 (21:09 +0100)]
eeprom 24xx: rename reset() helper method

6 years agoir_nec: Make timing margin relative
Grant Miller [Tue, 14 Nov 2017 09:31:05 +0000 (03:31 -0600)]
ir_nec: Make timing margin relative

This replaces the fixed timing margin with a percentage based tolerance
to better allow for timing inaccuracies, especially for longer timings
like the Leader and Repeat codes.

6 years agograycode: Move bitpack/bitunpack to common/.
Uwe Hermann [Sat, 9 Dec 2017 16:25:53 +0000 (17:25 +0100)]
graycode: Move bitpack/bitunpack to common/.

6 years agoAdd a gray code and rotary encoder protocol decoder.
Christoph Rackwitz [Mon, 18 Sep 2017 19:15:09 +0000 (21:15 +0200)]
Add a gray code and rotary encoder protocol decoder.

6 years agoAdd a morse code protocol decoder.
Christoph Rackwitz [Thu, 21 Sep 2017 01:28:33 +0000 (03:28 +0200)]
Add a morse code protocol decoder.

6 years agoi2s: Fix unportable use of struct.pack
Marcus Comstedt [Mon, 27 Nov 2017 09:54:35 +0000 (10:54 +0100)]
i2s: Fix unportable use of struct.pack

Using the format string 'I' with the default (implied) prefix '@'
results in both word size and endianness being platform dependent.
In this case standard size (32 bits) and little endianness is
required, so the prefix '<' needs to be used.

6 years agomaple_bus: Add helpers to make the call sites a bit shorter.
Uwe Hermann [Sat, 9 Dec 2017 12:29:02 +0000 (13:29 +0100)]
maple_bus: Add helpers to make the call sites a bit shorter.

6 years agoAdd an initial Maple bus decoder.
Marcus Comstedt [Mon, 20 Nov 2017 19:01:24 +0000 (20:01 +0100)]
Add an initial Maple bus decoder.

6 years agoinstance.c: Removed redundant variable
Joel Holdsworth [Thu, 28 Sep 2017 03:15:04 +0000 (21:15 -0600)]
instance.c: Removed redundant variable

6 years agoconfigure.ac: Added AC_C_BIGENDIAN to autoconf
Joel Holdsworth [Thu, 5 Oct 2017 15:00:30 +0000 (09:00 -0600)]
configure.ac: Added AC_C_BIGENDIAN to autoconf

This is needed so that WORDS_BIGENDIAN is defined on big-endian
systems, which is needed by version.c .

6 years agoi2s: Set file size to 4Gb
Joel Holdsworth [Wed, 8 Nov 2017 02:55:50 +0000 (19:55 -0700)]
i2s: Set file size to 4Gb

6 years agoi2s: Make 32-bit wav files
Joel Holdsworth [Wed, 8 Nov 2017 02:55:15 +0000 (19:55 -0700)]
i2s: Make 32-bit wav files

6 years agods243x: Add binary output for data read from EEPROM
Soeren Apel [Wed, 25 Oct 2017 07:28:56 +0000 (09:28 +0200)]
ds243x: Add binary output for data read from EEPROM

6 years agoRename ds2432 to ds243x
Soeren Apel [Wed, 25 Oct 2017 07:22:58 +0000 (09:22 +0200)]
Rename ds2432 to ds243x

6 years agods2432: Adapt to allow for DS2433 as well
Soeren Apel [Tue, 31 Oct 2017 20:17:53 +0000 (21:17 +0100)]
ds2432: Adapt to allow for DS2433 as well

6 years agods2432: Simplify MAC printing.
Uwe Hermann [Thu, 19 Oct 2017 07:36:17 +0000 (09:36 +0200)]
ds2432: Simplify MAC printing.

6 years agods2432: Add a Maxim DS2432 protocol decoder.
Kevin Redon [Thu, 19 Oct 2017 07:08:42 +0000 (09:08 +0200)]
ds2432: Add a Maxim DS2432 protocol decoder.

This fixes (parts of) bug #1019.

6 years agosrd_init(): Print list of decoder search paths in debug output.
Uwe Hermann [Fri, 22 Sep 2017 09:45:47 +0000 (11:45 +0200)]
srd_init(): Print list of decoder search paths in debug output.

6 years agoClarify and improve channel map debug output.
Uwe Hermann [Tue, 5 Sep 2017 22:37:35 +0000 (00:37 +0200)]
Clarify and improve channel map debug output.

6 years agousb_request: Remove code duplication, save end sample in central location
Stefan Brüns [Sat, 22 Jul 2017 18:17:10 +0000 (20:17 +0200)]
usb_request: Remove code duplication, save end sample in central location

6 years agousb_request: Handle CONTROL transfer protocol stalls
Stefan Brüns [Sat, 22 Jul 2017 17:54:59 +0000 (19:54 +0200)]
usb_request: Handle CONTROL transfer protocol stalls

According to the USB 2.0 spec, 8.5.3.4, a protocol stall condition lasts
until the next SETUP transfer. On reception of the SETUP, adjust the end
sample accordingly, and flush the previous CONTROL transfer.

6 years agoFix a unit test.
Uwe Hermann [Thu, 6 Jul 2017 06:23:34 +0000 (08:23 +0200)]
Fix a unit test.

Only try to acquire the GIL if the Python interpreter is actually
initialized, otherwise there'll be a segfault.

6 years agocan: introduce clock synchronization (simple implementation)
Gerhard Sittig [Sun, 2 Jul 2017 10:39:08 +0000 (12:39 +0200)]
can: introduce clock synchronization (simple implementation)

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
6 years agocan: rename 'bitpos' variable
Gerhard Sittig [Sun, 2 Jul 2017 10:23:09 +0000 (12:23 +0200)]
can: rename 'bitpos' variable

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.

6 years agoself.put(): Eliminate an unneeded malloc/free pair.
Uwe Hermann [Fri, 30 Jun 2017 16:42:13 +0000 (18:42 +0200)]
self.put(): Eliminate an unneeded malloc/free pair.

6 years agoAcquire/release the Python GIL where needed to avoid threading issues.
Uwe Hermann [Wed, 28 Jun 2017 20:29:06 +0000 (22:29 +0200)]
Acquire/release the Python GIL where needed to avoid threading issues.

With these additions, frontends can now call libsigrokdecode API
functions from different threads without running into threading issues.

The backend releases the GIL when it is performing tasks that might take
a while and it doesn't need to run Python/C API calls during that time.

This allows frontends to run multiple PD stacks (in multiple frontend
threads) "at the same time" in a time-sharing, "interlocked" manner.
Whenever one of the decoders is inside e.g. self.wait() it releases the
GIL and thus allows other decoders to do some work in the mean time.

The user-visible effect is that for use-cases such as running 3 different
decoder stacks at the same time for an acquisition, the user will not
have to wait for PD 1 to finish decoding, then wait for PD 2 to finish
decoding, and only *then* being able to see annotations from PD 3.

Instead, all three PDs will decode some chunks of data from time to
time, thus the user is able to inspect annotations from all 3 PDs while
the acquisition and decoding is still going on.

6 years agoHACKING: Prefer git pull requests over mailing list patches.
Uwe Hermann [Fri, 16 Jun 2017 18:48:07 +0000 (20:48 +0200)]
HACKING: Prefer git pull requests over mailing list patches.

Also, drop the reference to gitorious.org (no longer available).

6 years agopwm: Drop unused 'pins' variable.
Uwe Hermann [Wed, 21 Jun 2017 06:32:43 +0000 (08:32 +0200)]
pwm: Drop unused 'pins' variable.

6 years agoir_rc5: Rephrase open coded value for start bit 1
Gerhard Sittig [Sun, 18 Jun 2017 18:02:46 +0000 (20:02 +0200)]
ir_rc5: Rephrase open coded value for start bit 1

Make obvious that the start bit's value is 1 in the IDLE stage.

6 years agolpc: Improve robustness when decoding unexpected input data
Gerhard Sittig [Sun, 18 Jun 2017 10:24:32 +0000 (12:24 +0200)]
lpc: Improve robustness when decoding unexpected input data

The 'fields' table of state and descriptions is not fully populated,
some slots are missing. Cope with lookup misses when unexpected input
data is not found in the table. Use different error text in annotations
for described but invalid states (the previous implementation used
"reserved / invalid"), and for states that are not described in the
table (introduce the "reserved / unknown" text for conditions that are
not covered by the decoder implementation).

The previous implementation missed the emission of some warnings. When a
"reserved / invalid" description was found, the subsequent exact match
for "reserved" failed and the warning was not emitted. Weaken the test
to emit warnings for either description that has "reserved" in it,
regardless of whether the text was found in the table or is not part of
the table at all.

6 years agolpc: Nit, remove an unused variable
Gerhard Sittig [Sun, 18 Jun 2017 10:19:32 +0000 (12:19 +0200)]
lpc: Nit, remove an unused variable

6 years agoonewire_network: Fixup start samplenumber for annotations
Gerhard Sittig [Fri, 17 Mar 2017 19:28:59 +0000 (20:28 +0100)]
onewire_network: Fixup start samplenumber for annotations

Annotations generated by the onewire_network decoder started where bit 1
began, while it should align with the start of bit 0.

6 years agoguess_bitrate: Eliminate internal state of the decoder
Gerhard Sittig [Sun, 18 Jun 2017 18:46:40 +0000 (20:46 +0200)]
guess_bitrate: Eliminate internal state of the decoder

Getting the first edge outside of the loop in .decode() greatly
simplifies the logic, any other edge then is just an update of the
previously collected data, determined by always equal code.

6 years agoi2c: Don't drop the first sample of input data
Gerhard Sittig [Sun, 18 Jun 2017 17:32:57 +0000 (19:32 +0200)]
i2c: Don't drop the first sample of input data

The previous implementation of the I2C decoder used to retrieve and not
process the first sample of the input stream. Remove this instruction.

6 years agodecoders: Rephrase condition-less .wait() calls (self documentation)
Gerhard Sittig [Sun, 18 Jun 2017 17:27:47 +0000 (19:27 +0200)]
decoders: Rephrase condition-less .wait() calls (self documentation)

Telling .wait() to "skip one sample" slightly obfuscates the intent of
getting the next samples while no condition applies. Explicitly pass no
condition arguments instead, to better reflect the purpose. Coincidently
these .wait() calls will execute in slightly less expensive code paths
in the common code.

6 years agodecoder: Accept more forms of "unconditional wait()" (None, no args)
Gerhard Sittig [Sun, 5 Mar 2017 17:31:18 +0000 (18:31 +0100)]
decoder: Accept more forms of "unconditional wait()" (None, no args)

The Decoder.wait() method expects a list of dicts, or as a special form
a single dict, to specify the conditions to wait for. An empty dict or
an empty list mean "unconditional wait", requesting the very next sample.

Accept None as well as no arguments at all in Decoder.wait() calls. This
shall better reflect the intent and slightly unobfuscate PD code, as well
as avoid creation of potentially expensive Python objects at the call site.

6 years agodecoder: Unbreak execution of Decoder.wait() with empty condition
Gerhard Sittig [Sun, 18 Jun 2017 17:12:11 +0000 (19:12 +0200)]
decoder: Unbreak execution of Decoder.wait() with empty condition

The Decoder.wait() method works as expected when non-empty conditions
are specified by the caller. For empty conditions the implementation was
incomplete, and ended up in an infinite loop because the sample number
got stuck in the current location. Code review revealed more issues like
not getting more input data chunks when needed.

Detect when empty wait() conditions were specified, and re-use existing
code paths for match handling as much as possible. This is achieved by
the manual creation of a SKIP term with the appropriate count value.
It's assumed that naive decoder implementations will run this kind of
condition-less query for every individual sample, which means that
efficiency is important.

Make sample number 0 available to condition-less calls, too. Don't skip
the first sample in the input stream.

6 years agousb_signalling: Move another edge detection to common backend code
Gerhard Sittig [Sun, 18 Jun 2017 13:51:35 +0000 (15:51 +0200)]
usb_signalling: Move another edge detection to common backend code

Rephrase how the 'WAIT IDLE' stage skips over all-low input signals.
Have the next high level on either line detected in common code.

6 years agopwm: Fixup sample numbers for binary output
Gerhard Sittig [Sun, 18 Jun 2017 11:50:48 +0000 (13:50 +0200)]
pwm: Fixup sample numbers for binary output

Do reference the period's start and end sample numbers when the
duty cycle is written to the binary output stream. The previous
implementation inappropriately used the period counter instead.