]> sigrok.org Git - libsigrokdecode.git/log
libsigrokdecode.git
7 years agopwm: Rephrase edge and period detection, eliminate internal state
Gerhard Sittig [Sun, 18 Jun 2017 10:59:31 +0000 (12:59 +0200)]
pwm: Rephrase edge and period detection, eliminate internal state

With the simplicity of PWM waveforms and the convenience of the v3 API,
there is no need to maintain internal state. After the start of the
first period was determined based on the input signal's polarity, any
period is defined by just the next two edges, and the next period is
immediately to follow.

7 years agoDrop support for PD API version 2.
Uwe Hermann [Fri, 16 Jun 2017 14:32:24 +0000 (16:32 +0200)]
Drop support for PD API version 2.

All decoders must be of PD API version 3 now.

7 years agoMark all stacked decoders as being PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 14:27:08 +0000 (16:27 +0200)]
Mark all stacked decoders as being PD API version 3.

This is not really relevant for stacked PDs currently (they can be used
unmodified with either PDv2 or PDv3 low-level decoders), but it'll allow
us to drop PDv2 support completely.

7 years agoir_rc5: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 14:23:10 +0000 (16:23 +0200)]
ir_rc5: Convert to PD API version 3.

7 years agodsi: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 14:22:57 +0000 (16:22 +0200)]
dsi: Convert to PD API version 3.

7 years agodsi: Cosmetics, drop obsolete comments.
Uwe Hermann [Fri, 16 Jun 2017 14:17:50 +0000 (16:17 +0200)]
dsi: Cosmetics, drop obsolete comments.

7 years agorgb_led_ws281x: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 14:13:19 +0000 (16:13 +0200)]
rgb_led_ws281x: Convert to PD API version 3.

7 years agolpc: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 14:09:00 +0000 (16:09 +0200)]
lpc: Convert to PD API version 3.

7 years agowiegand: Convert to PD API version 3.
Gerhard Sittig [Sun, 15 Jan 2017 12:09:36 +0000 (13:09 +0100)]
wiegand: Convert to PD API version 3.

7 years agousb_signalling: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 11:37:21 +0000 (13:37 +0200)]
usb_signalling: Convert to PD API version 3.

7 years agodali: Change 'self.dali' to 'dali'.
Uwe Hermann [Fri, 16 Jun 2017 10:14:28 +0000 (12:14 +0200)]
dali: Change 'self.dali' to 'dali'.

7 years agodali: Convert to PD API version 3.
Uwe Hermann [Fri, 16 Jun 2017 10:08:50 +0000 (12:08 +0200)]
dali: Convert to PD API version 3.

7 years agodali: Random cleanups, remove obsolete comments.
Uwe Hermann [Fri, 16 Jun 2017 08:45:36 +0000 (10:45 +0200)]
dali: Random cleanups, remove obsolete comments.

7 years agoinstance.c: Drop a few unneeded checks.
Uwe Hermann [Thu, 15 Jun 2017 22:22:40 +0000 (00:22 +0200)]
instance.c: Drop a few unneeded checks.

7 years agospi: Simplify some code chunks.
Uwe Hermann [Thu, 15 Jun 2017 21:34:56 +0000 (23:34 +0200)]
spi: Simplify some code chunks.

7 years agodmx512: Use a nicer 'dmx' pin name variable.
Uwe Hermann [Thu, 15 Jun 2017 20:27:43 +0000 (22:27 +0200)]
dmx512: Use a nicer 'dmx' pin name variable.

7 years agodmx512: Convert to PD API version 3.
Uwe Hermann [Thu, 15 Jun 2017 20:02:52 +0000 (22:02 +0200)]
dmx512: Convert to PD API version 3.

7 years agopwm: Reduce indentation level.
Uwe Hermann [Thu, 15 Jun 2017 19:35:25 +0000 (21:35 +0200)]
pwm: Reduce indentation level.

7 years agopwm: Simplify waiting for initial edge.
Uwe Hermann [Thu, 15 Jun 2017 19:33:56 +0000 (21:33 +0200)]
pwm: Simplify waiting for initial edge.

7 years agosession.c: Fix a compiler warning on Mac OS X.
Uwe Hermann [Thu, 15 Jun 2017 15:52:55 +0000 (17:52 +0200)]
session.c: Fix a compiler warning on Mac OS X.

  session.c:203:22: warning: format specifies type 'unsigned long long'
  but the argument has type 'guint64' (aka 'unsigned long') [-Wformat]
                          sess->session_id, g_variant_get_uint64(data));
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  libsigrokdecode-internal.h:103:44: note: expanded from macro 'srd_dbg'
  #define srd_dbg(...)    srd_log(SRD_LOG_DBG,  __VA_ARGS__)
                                                ^~~~~~~~~~~

7 years agoconfigure.ac: Bump package version to 0.6.0. libsigrokdecode-unreleased
Uwe Hermann [Thu, 15 Jun 2017 14:16:09 +0000 (16:16 +0200)]
configure.ac: Bump package version to 0.6.0.

0.6.0 will be the next major release. Bump now, so that
there is no confusion of tarball 0.5.0 and 0.6.0-git snapshots.

7 years agoBump libtool version (not package version) to 4:0:0.
Uwe Hermann [Mon, 12 Jun 2017 01:16:21 +0000 (03:16 +0200)]
Bump libtool version (not package version) to 4:0:0.

The last release (0.4.0) had the libtool version (current:revision:age)
set to 3:0:0. Since this release removes and changes interfaces, the
new version is 4:0:0.

http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info

This changes the library filename (e.g. on Linux) from
libsigrokdecode.so.3.0.0 to libsigrokdecode.so.4.0.0, the SONAME
(+symlink) becomes libsigrokdecode.so.4.

7 years agoNEWS: Add list of user-visible changes so far.
Uwe Hermann [Fri, 9 Jun 2017 13:00:46 +0000 (15:00 +0200)]
NEWS: Add list of user-visible changes so far.

7 years agoVarious Doxygen fixes.
Uwe Hermann [Mon, 12 Jun 2017 00:50:23 +0000 (02:50 +0200)]
Various Doxygen fixes.

7 years agospi: Missing samplerate spec is not fatal
Gerhard Sittig [Tue, 6 Jun 2017 21:12:04 +0000 (23:12 +0200)]
spi: Missing samplerate spec is not fatal

Check for the availability of a samplerate specification, but don't
abort in its absence. Lack of the samplerate only prevents the emission
of throughput annotations, but still allows decoding the clocked signal.

7 years agospi: Improve use of PD API version 3
Gerhard Sittig [Tue, 6 Jun 2017 20:55:52 +0000 (22:55 +0200)]
spi: Improve use of PD API version 3

Eliminate more instances where Python code tracked signal changes instead
of having common library code do the work. Reduce the number of boundary
crossings between library and decoder code (Python vs C), by inspecting
fewer input edges. Yet cope with the CS signal's being optional. Emit
identical annotations to the previous implementation for CS changes,
including the initial change "from None to 0/1". Sort the checks for
optional input signals at the top of decode() into a more natural order.
Improve and update comments.

This commit results in a more appropriate use of the PD v3 API in the
SPI protocol decoder.

7 years agogpib: Convert to PD API version 3
Gerhard Sittig [Tue, 6 Jun 2017 19:13:27 +0000 (21:13 +0200)]
gpib: Convert to PD API version 3

Have edges detected in common library code. Cope with optional initial
low level (without an edge) at the start of sample data. Handle the
optionally enforced processing at a specified sample number.

7 years agopwm: Convert to PD API version 3
Gerhard Sittig [Tue, 6 Jun 2017 18:32:07 +0000 (20:32 +0200)]
pwm: Convert to PD API version 3

Have edges detected in common library code.

7 years agospi: Convert to PD API version 3
Gerhard Sittig [Tue, 6 Jun 2017 18:05:05 +0000 (20:05 +0200)]
spi: Convert to PD API version 3

Have edges detected in common library code. Move the test for presence
of optional channels out of the decode loop. Do inspect the very first
sample for pixel compatibility with the previous implementation.

7 years agoHACKING: Update URL to Linux kernel coding style.
Uwe Hermann [Tue, 6 Jun 2017 12:43:08 +0000 (14:43 +0200)]
HACKING: Update URL to Linux kernel coding style.

7 years agoRename eeprom93cxx decoder to eeprom93xx.
Uwe Hermann [Tue, 6 Jun 2017 10:46:08 +0000 (12:46 +0200)]
Rename eeprom93cxx decoder to eeprom93xx.

Not all EEPROMs of this series have (just) a 'c' in the name.

7 years agoeeprom24xx: Don't make lists.py executable.
Uwe Hermann [Tue, 6 Jun 2017 10:40:58 +0000 (12:40 +0200)]
eeprom24xx: Don't make lists.py executable.

7 years agoDrop trailing whitespace in various PDs.
Uwe Hermann [Tue, 6 Jun 2017 09:51:04 +0000 (11:51 +0200)]
Drop trailing whitespace in various PDs.

7 years agoAdd srd_inst_initial_pins_set_all() and support code.
Uwe Hermann [Thu, 11 May 2017 21:20:58 +0000 (23:20 +0200)]
Add srd_inst_initial_pins_set_all() and support code.

This allows frontends to set the assumed initial pins (i.e., the assumed
state of the pins before the first sample of a capture) to user-specified
values.

The assumed initial pins can be either low, or high, or "use same value
as the first sample of the capture".

The special self.initial_pins decoder attribute is now removed.

7 years agoRename maxim_ds28ea00 to ds28ea00.
Uwe Hermann [Mon, 5 Jun 2017 15:00:04 +0000 (17:00 +0200)]
Rename maxim_ds28ea00 to ds28ea00.

None of the other PDs have a vendorname in the PD name.

7 years agostruct srd_decoder: Add list of input/output decoder IDs.
Uwe Hermann [Wed, 31 May 2017 20:51:23 +0000 (22:51 +0200)]
struct srd_decoder: Add list of input/output decoder IDs.

7 years agoShow lib versions in the debug output.
Uwe Hermann [Fri, 26 May 2017 15:19:53 +0000 (17:19 +0200)]
Show lib versions in the debug output.

7 years agocan: Skip stuff bit inspection where not applicable
Gerhard Sittig [Sun, 14 May 2017 17:08:37 +0000 (19:08 +0200)]
can: Skip stuff bit inspection where not applicable

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.

7 years agocan: Convert to PD API version 3
Gerhard Sittig [Sun, 14 May 2017 17:36:17 +0000 (19:36 +0200)]
can: Convert to PD API version 3

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.

7 years agocan: Add warnings for various invalid bits and fields.
Uwe Hermann [Thu, 25 May 2017 21:42:58 +0000 (23:42 +0200)]
can: Add warnings for various invalid bits and fields.

7 years agosdcard_sd: reference latest command when displaying response
Wolfram Sang [Fri, 12 May 2017 11:58:28 +0000 (13:58 +0200)]
sdcard_sd: reference latest command when displaying response

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 <redacted>
7 years agosdcard_sd: output CMD8 in cmd8-handler
Wolfram Sang [Fri, 12 May 2017 11:58:27 +0000 (13:58 +0200)]
sdcard_sd: output CMD8 in cmd8-handler

Probably a typo, currently 'cmd0' gets pushed out.

Signed-off-by: Wolfram Sang <redacted>
7 years agotiming: Drop obsolete self.oldpin variable.
Uwe Hermann [Sat, 13 May 2017 13:51:59 +0000 (15:51 +0200)]
timing: Drop obsolete self.oldpin variable.

7 years agotiming: "normalize" negative times too
Karl Palsson [Fri, 20 Jan 2017 16:23:50 +0000 (16:23 +0000)]
timing: "normalize" negative times too

Use the same scale.

Signed-off-by: Karl Palsson <redacted>
7 years agotiming: add edge-edge mode and delta calculation
Karl Palsson [Fri, 20 Jan 2017 16:24:29 +0000 (16:24 +0000)]
timing: add edge-edge mode and delta calculation

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 <redacted>
7 years agotiming: disable averaging if set to zero
Karl Palsson [Fri, 20 Jan 2017 16:03:21 +0000 (16:03 +0000)]
timing: disable averaging if set to zero

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 <redacted>
7 years agoRename ade7758 decoder to ade77xx.
Uwe Hermann [Thu, 11 May 2017 22:24:41 +0000 (00:24 +0200)]
Rename ade7758 decoder to ade77xx.

There are multiple devices in the ADE77xx series that are similar enough
to be supportable via this decoder in the future.

7 years agoade7758: Slightly shorten some code chunks.
Uwe Hermann [Sun, 30 Apr 2017 16:16:21 +0000 (18:16 +0200)]
ade7758: Slightly shorten some code chunks.

7 years agoAdd an ADE7758 protocol decoder.
Karl Palsson [Fri, 13 Jan 2017 16:55:26 +0000 (16:55 +0000)]
Add an ADE7758 protocol decoder.

No value decoding, that can be fairly complicated.

Signed-off-by: Karl Palsson <redacted>
7 years agosdcard_sd: remove unused functions
Wolfram Sang [Wed, 3 May 2017 19:00:57 +0000 (21:00 +0200)]
sdcard_sd: remove unused functions

putr2 is unused, so let it go.

Signed-off-by: Wolfram Sang <redacted>
7 years agoeeprom93cxx: Improve longname.
Uwe Hermann [Sat, 6 May 2017 18:07:09 +0000 (20:07 +0200)]
eeprom93cxx: Improve longname.

7 years agomicrowire/eeprom93cxx: Use 'es' instead of 'se' abbrevation.
Uwe Hermann [Fri, 5 May 2017 18:33:26 +0000 (20:33 +0200)]
microwire/eeprom93cxx: Use 'es' instead of 'se' abbrevation.

(for consistency with all other decoders)

7 years agoeeprom93cxx: Update wrt Python output namedtuple usage.
Uwe Hermann [Fri, 5 May 2017 18:31:20 +0000 (20:31 +0200)]
eeprom93cxx: Update wrt Python output namedtuple usage.

7 years agoeeprom93cxx: Shorten put_word() a bit.
Uwe Hermann [Wed, 3 May 2017 20:37:15 +0000 (22:37 +0200)]
eeprom93cxx: Shorten put_word() a bit.

7 years agoAdd a 93Cxx Microwire EEPROM protocol decoder.
Kevin Redon [Wed, 3 May 2017 20:21:46 +0000 (22:21 +0200)]
Add a 93Cxx Microwire EEPROM protocol decoder.

This fixes parts of bug #931.

7 years agomicrowire: Use namedtuple in some more cases.
Uwe Hermann [Fri, 5 May 2017 18:21:22 +0000 (20:21 +0200)]
microwire: Use namedtuple in some more cases.

7 years agomicrowire: Use namedtuple for the Python output.
Uwe Hermann [Fri, 5 May 2017 18:18:54 +0000 (20:18 +0200)]
microwire: Use namedtuple for the Python output.

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.

7 years agomicrowire: Drop some trailing whitespace.
Uwe Hermann [Fri, 5 May 2017 06:45:07 +0000 (08:45 +0200)]
microwire: Drop some trailing whitespace.

7 years agomicrowire: Shorten decode() a bit.
Uwe Hermann [Fri, 5 May 2017 06:11:32 +0000 (08:11 +0200)]
microwire: Shorten decode() a bit.

7 years agomicrowire: Make Ready/Busy extra annotation classes.
Uwe Hermann [Wed, 3 May 2017 20:07:29 +0000 (22:07 +0200)]
microwire: Make Ready/Busy extra annotation classes.

7 years agomicrowire: Make the start bit an extra annotation class.
Uwe Hermann [Wed, 3 May 2017 20:06:51 +0000 (22:06 +0200)]
microwire: Make the start bit an extra annotation class.

7 years agoAdd a Microwire protocol decoder.
Kevin Redon [Wed, 3 May 2017 19:29:49 +0000 (21:29 +0200)]
Add a Microwire protocol decoder.

This fixes parts of bug #931.

7 years agosdcard_sd: really show result of SET_BLOCKLEN
Wolfram Sang [Wed, 26 Apr 2017 15:17:32 +0000 (17:17 +0200)]
sdcard_sd: really show result of SET_BLOCKLEN

Now that self.arg is populated, we can finally use it.

Signed-off-by: Wolfram Sang <redacted>
7 years agosdcard_sd: always show CMD argument in hex
Wolfram Sang [Wed, 26 Apr 2017 15:17:31 +0000 (17:17 +0200)]
sdcard_sd: always show CMD argument in hex

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 <redacted>
7 years agosdcard_sd: don't interate over not implemented command
Wolfram Sang [Wed, 26 Apr 2017 15:17:30 +0000 (17:17 +0200)]
sdcard_sd: don't interate over not implemented command

There is no handler for CMD4 yet.

Signed-off-by: Wolfram Sang <redacted>
7 years agoonewire_link: (Re-)convert to PD API version 3.
Uwe Hermann [Fri, 7 Apr 2017 06:09:56 +0000 (08:09 +0200)]
onewire_link: (Re-)convert to PD API version 3.

7 years agoonewire_link: Factor out some helper methods.
Uwe Hermann [Thu, 6 Apr 2017 17:27:37 +0000 (19:27 +0200)]
onewire_link: Factor out some helper methods.

This avoids some boilerplate in the decode() method itself.

7 years agoImplement new 1-Wire link decoder using time ranges
King Kévin [Sun, 26 Mar 2017 17:31:56 +0000 (19:31 +0200)]
Implement new 1-Wire link decoder using time ranges

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.

7 years agoiec: Convert to PD API version 3
Marcus Comstedt [Fri, 31 Mar 2017 18:21:08 +0000 (20:21 +0200)]
iec: Convert to PD API version 3

7 years agoDon't show a harmless/confusing warning on stdout.
Uwe Hermann [Fri, 31 Mar 2017 17:18:19 +0000 (19:18 +0200)]
Don't show a harmless/confusing warning on stdout.

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).

7 years agoeeprom24xx: add Xicor X24C02 variant
fenugrec [Mon, 20 Mar 2017 22:56:25 +0000 (18:56 -0400)]
eeprom24xx: add Xicor X24C02 variant

7 years agodali: Use a slightly better variable name.
Uwe Hermann [Sat, 18 Mar 2017 22:03:17 +0000 (23:03 +0100)]
dali: Use a slightly better variable name.

7 years agodsi: Use a slightly better variable name.
Uwe Hermann [Sat, 18 Mar 2017 22:01:56 +0000 (23:01 +0100)]
dsi: Use a slightly better variable name.

7 years agodsi: Small fix for the longname.
Uwe Hermann [Sat, 18 Mar 2017 21:58:41 +0000 (22:58 +0100)]
dsi: Small fix for the longname.

7 years agoAdd a DALI protocol decoder.
Jeremy Swanson [Thu, 16 Feb 2017 16:29:47 +0000 (16:29 +0000)]
Add a DALI protocol decoder.

7 years agoAdd a DSI protocol decoder.
Jeremy Swanson [Thu, 16 Feb 2017 16:29:47 +0000 (16:29 +0000)]
Add a DSI protocol decoder.

7 years agouart: Minor cosmetic changes.
Uwe Hermann [Wed, 15 Mar 2017 08:27:43 +0000 (09:27 +0100)]
uart: Minor cosmetic changes.

7 years agouart: Use consistent order of steps when processing samples
Gerhard Sittig [Tue, 14 Mar 2017 18:01:04 +0000 (19:01 +0100)]
uart: Use consistent order of steps when processing samples

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.

7 years agouart: Remove redundant "reached bit" checks
Gerhard Sittig [Tue, 14 Mar 2017 18:15:31 +0000 (19:15 +0100)]
uart: Remove redundant "reached bit" checks

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.

7 years agouart: Improve robustness of query API result processing
Gerhard Sittig [Tue, 14 Mar 2017 17:46:32 +0000 (18:46 +0100)]
uart: Improve robustness of query API result processing

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.

7 years agouart: Reduce redundancy in sample inspection (state machine)
Gerhard Sittig [Tue, 14 Mar 2017 17:15:51 +0000 (18:15 +0100)]
uart: Reduce redundancy in sample inspection (state machine)

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.

7 years agouart: Convert to PD API version 3
Gerhard Sittig [Tue, 14 Mar 2017 17:00:06 +0000 (18:00 +0100)]
uart: Convert to PD API version 3

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.

7 years agouart: Minor readability nit (position of start bit in calculation)
Gerhard Sittig [Tue, 14 Mar 2017 16:10:28 +0000 (17:10 +0100)]
uart: Minor readability nit (position of start bit in calculation)

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.

7 years agouart: Immediately skip reception of parity bits when not applicable
Gerhard Sittig [Tue, 14 Mar 2017 14:35:27 +0000 (15:35 +0100)]
uart: Immediately skip reception of parity bits when not applicable

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.

7 years agouart: Remove an obsolete unused routine
Gerhard Sittig [Tue, 14 Mar 2017 14:33:07 +0000 (15:33 +0100)]
uart: Remove an obsolete unused routine

7 years agodecoder: terminate .wait() and .decode(), join threads for v3 instances
Gerhard Sittig [Sun, 5 Mar 2017 17:09:59 +0000 (18:09 +0100)]
decoder: terminate .wait() and .decode(), join threads for v3 instances

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.

7 years agoconfigure summary: Show linker flags.
Uwe Hermann [Sun, 5 Mar 2017 16:05:06 +0000 (17:05 +0100)]
configure summary: Show linker flags.

7 years agoconfigure summary: Show whether shared/static build is enabled.
Uwe Hermann [Sun, 5 Mar 2017 16:04:38 +0000 (17:04 +0100)]
configure summary: Show whether shared/static build is enabled.

7 years agorgb_led_ws281x: Use self.samplenum.
Uwe Hermann [Sat, 4 Mar 2017 13:30:18 +0000 (14:30 +0100)]
rgb_led_ws281x: Use self.samplenum.

This is currently just a cosmetic change, but will make the conversion
to the PDv3 API slightly easier and more readable.

7 years agoDrop obsolete workarounds in PDs.
Uwe Hermann [Wed, 1 Mar 2017 23:03:16 +0000 (00:03 +0100)]
Drop obsolete workarounds in PDs.

Some PDs were using a temporary workaround for (as it turned out) a
refcounting issue that was fixed in 066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a.

7 years agosrd_decoder_load(): Drop dead code.
Uwe Hermann [Tue, 28 Feb 2017 08:04:55 +0000 (09:04 +0100)]
srd_decoder_load(): Drop dead code.

In 'except_out' the fail_txt variable is always non-NULL.

7 years agoFix memory leak in get_current_pinvalues()
Marcus Comstedt [Mon, 27 Feb 2017 21:33:17 +0000 (22:33 +0100)]
Fix memory leak in get_current_pinvalues()

The ownership of the tuple reference is transferred to the caller, so
the refcount should not be increased.

7 years agoMore refcounting fixes
Marcus Comstedt [Mon, 27 Feb 2017 21:24:23 +0000 (22:24 +0100)]
More refcounting fixes

PyList_SetItem steals a reference, so code calling that must either
transfer ownership or increase the refcount.

7 years agoinstance.c: Add a debug message for thread creation.
Uwe Hermann [Mon, 27 Feb 2017 07:42:44 +0000 (08:42 +0100)]
instance.c: Add a debug message for thread creation.

7 years agosrd_inst_decode(): Slightly more verbose error message.
Uwe Hermann [Sun, 26 Feb 2017 14:55:00 +0000 (15:55 +0100)]
srd_inst_decode(): Slightly more verbose error message.

7 years agoFix examples to show abs_end_samplenum as exclusive
Marcus Comstedt [Sun, 26 Feb 2017 12:10:06 +0000 (13:10 +0100)]
Fix examples to show abs_end_samplenum as exclusive

7 years agoReturn SRD_ERR_ARG from srd_inst_decode if samplenums are wrong
Marcus Comstedt [Sun, 26 Feb 2017 12:07:03 +0000 (13:07 +0100)]
Return SRD_ERR_ARG from srd_inst_decode if samplenums are wrong

This validates the requirements that
* abs_start_samplenum continues where the previous decode ended
* abs_end_samplenum is not lower than abs_start_samplenum

Failure to meet these requirements will make v3 decoders crash.

7 years agoFix refcounting bug in set_new_condition_list()
Marcus Comstedt [Sun, 26 Feb 2017 11:52:12 +0000 (12:52 +0100)]
Fix refcounting bug in set_new_condition_list()

py_conditionlist is an owned reference (it gets passed to Py_DecRef()
at the end), so we need to increment the refcount when assigning it
from the borrowed reference py_conds.

7 years agoinstance.c: fix a 'matched' vs 'matches' typo
Gerhard Sittig [Sun, 26 Feb 2017 08:16:36 +0000 (09:16 +0100)]
instance.c: fix a 'matched' vs 'matches' typo

The Decoder_wait() routine will populate the .matched attribute before
returning to the caller. The srd_inst_start() routine used to setup a
.matches attribute which is unexpected. Make both routines consistently
assign to 'matched' as that is what Python decoder implementations are
referencing.

7 years agoAdd an initial serial GPIB (IEC) decoder.
Marcus Comstedt [Wed, 15 Feb 2017 18:14:27 +0000 (19:14 +0100)]
Add an initial serial GPIB (IEC) decoder.