]> sigrok.org Git - libsigrok.git/log
libsigrok.git
7 years agofx2lafw/dslogic: Updated bRequest #defines to reflect libsigrok4DSL
Joel Holdsworth [Thu, 8 Jun 2017 22:45:38 +0000 (16:45 -0600)]
fx2lafw/dslogic: Updated bRequest #defines to reflect libsigrok4DSL

7 years agofx2lafw: Call dslogic_get_number_of_transfers into fx2lafw_get_number_of_transfers
Joel Holdsworth [Thu, 8 Jun 2017 21:25:33 +0000 (15:25 -0600)]
fx2lafw: Call dslogic_get_number_of_transfers into fx2lafw_get_number_of_transfers

7 years agofx2lafw/dslogic: Added DSLogic Plus and Basic variants
Joel Holdsworth [Thu, 8 Jun 2017 16:59:13 +0000 (10:59 -0600)]
fx2lafw/dslogic: Added DSLogic Plus and Basic variants

7 years agoMakefile.am: Install MIME info file in $(datadir)/mime/packages.
Uwe Hermann [Thu, 15 Jun 2017 16:46:14 +0000 (18:46 +0200)]
Makefile.am: Install MIME info file in $(datadir)/mime/packages.

This fixes bug #983.

7 years agoconfigure.ac: Bump package version to 0.6.0. libsigrok-unreleased
Uwe Hermann [Thu, 15 Jun 2017 14:15:24 +0000 (16:15 +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:03:21 +0000 (03:03 +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 adds, 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 libsigrok.so.3.0.0
to libsigrok.so.4.0.0, the SONAME (+symlink) becomes libsigrok.so.4.

7 years agoNEWS: Add list of user-visible changes so far.
Uwe Hermann [Sun, 11 Jun 2017 17:38:23 +0000 (19:38 +0200)]
NEWS: Add list of user-visible changes so far.

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

7 years agoAdd a MIME info file (and icons) for sigrok session files.
Uwe Hermann [Sun, 11 Jun 2017 21:19:27 +0000 (23:19 +0200)]
Add a MIME info file (and icons) for sigrok session files.

File template by Stefan Brüns, thanks!

This fixes bug #857.

(the XML file is moved from PulseView to libsigrok since this is not
PulseView-specific)

Add a 48x48 PNG and a scalable SVG for the MIME type as well.

Install the XML file and in the icons in the respective standard paths.

7 years agoRename sigrok-logo-notext.png to libsigrok_112x112.png.
Uwe Hermann [Sun, 11 Jun 2017 21:03:09 +0000 (23:03 +0200)]
Rename sigrok-logo-notext.png to libsigrok_112x112.png.

This is more specific and prevents any potential issues e.g. when
multiple distro packages might ship with a generic file like
sigrok-logo-notext.png that's supposed to be installed in the same place.

7 years agoruby bindings: Fix a compiler warning.
Uwe Hermann [Thu, 8 Jun 2017 21:55:58 +0000 (23:55 +0200)]
ruby bindings: Fix a compiler warning.

  bindings/ruby/classes_wrap.cpp:10481:1: warning: control may reach end
  of non-void function [-Wreturn-type]

7 years agoFix various -Wundefined-var-template clang warnings.
Uwe Hermann [Thu, 8 Jun 2017 21:05:05 +0000 (23:05 +0200)]
Fix various -Wundefined-var-template clang warnings.

This fixes bug #915.

7 years agoC++ binding: Fixup memory leak in input module receive() calls
Gerhard Sittig [Fri, 9 Jun 2017 21:13:35 +0000 (23:13 +0200)]
C++ binding: Fixup memory leak in input module receive() calls

The Input::send() method allocated glib strings and copied input data,
but only released the glib string container and leaked the actual string
content. This led to leaks in the size of the verbatim input file, which
is especially wasteful for uncompressed textual representations.

This fixes bug #976.

7 years agoinput/csv: Eliminate remaining memory leaks in error paths
Gerhard Sittig [Fri, 9 Jun 2017 21:10:40 +0000 (23:10 +0200)]
input/csv: Eliminate remaining memory leaks in error paths

When the processing of columns of text lines detected errors, the loop
was aborted and the routine was left, but allocated resources were not
freed. Fix the remaining memory leaks in the error code paths.

7 years agoinput/csv: Fixup datafeed chunk size calculation
Gerhard Sittig [Fri, 9 Jun 2017 21:07:25 +0000 (23:07 +0200)]
input/csv: Fixup datafeed chunk size calculation

The constant at the top of the source file is the number of samples in a
datafeed submission chunk. The previous implementation erroneously made
it the size in bytes. There is no need to round down the buffer size
according to the unit size.

7 years agooutput/csv: Nit, remove an unused loop iteration variable
Gerhard Sittig [Thu, 4 May 2017 19:34:07 +0000 (21:34 +0200)]
output/csv: Nit, remove an unused loop iteration variable

The i variable is not used in the bottom loop in gen_header(). Remove it
to not obfuscate the purpose of the iteration.

7 years agoinput/csv: Send larger datafeed chunks, to speedup import
Gerhard Sittig [Thu, 8 Jun 2017 18:13:31 +0000 (20:13 +0200)]
input/csv: Send larger datafeed chunks, to speedup import

The previous implementation sent one sigrok session datafeed packet per
processed CSV line. This is rather inefficient for the CSV input module,
and triggers a dramatic performance loss in the srzip output format.

Communicate up to 128K samples within one datafeed packet. This fixes
bug #695.

Factor out repeated calculation of the unit size which is derived from
the channel count. Fix a minor memory leak in an error path while we are
here. (Other memory leaks in rare error paths remain with this commit.)

Suggested-By: Elias Oenal <redacted>
7 years agoinput/csv: Update developer comment (fix for last EOL marker)
Gerhard Sittig [Mon, 5 Jun 2017 17:33:42 +0000 (19:33 +0200)]
input/csv: Update developer comment (fix for last EOL marker)

7 years agoinput/csv: Accept absence of last end-of-line termination sequence
Gerhard Sittig [Mon, 5 Jun 2017 17:00:23 +0000 (19:00 +0200)]
input/csv: Accept absence of last end-of-line termination sequence

On the Windows platform it appears to be popular to _not_ terminate the
very last line in a text file. Which results in an unmet constraint in
the CSV input module and an internal exception in PulseView which aborts
program execution.

Cope with the absence of the text line termination sequence at the very
end of the input stream. Keep all other checks in place, such that only
completely received text lines get processed.

This fixes bug #635.

7 years agoinput/csv: Skip leading UTF-8 BOM in the input stream
Gerhard Sittig [Mon, 5 Jun 2017 16:35:22 +0000 (18:35 +0200)]
input/csv: Skip leading UTF-8 BOM in the input stream

This fixes bug #756.

7 years agoinput/csv: Add developer comment with TODO items
Gerhard Sittig [Mon, 5 Jun 2017 16:24:52 +0000 (18:24 +0200)]
input/csv: Add developer comment with TODO items

"Document" the current state of the implementation in the CSV input
module's source code. Discuss how text handling is non-trivial, which
approaches are available and how they have drawbacks.

Mention the lack of support for the import of analog data as well.

7 years agoinput/csv: Correctly skip over last processed end-of-line sequence
Gerhard Sittig [Mon, 5 Jun 2017 14:41:42 +0000 (16:41 +0200)]
input/csv: Correctly skip over last processed end-of-line sequence

The CSV input module supports variable length end-of-line encodings
(either CRLF, or CR, or LF). When a bunch of accumulated text lines got
processed, do skip the corresponding number of characters after the end
of the last processed line.

This fixes one of the issues discussed in bug #635.

7 years agoinput/csv: Fix a false negative after successful import
Gerhard Sittig [Mon, 5 Jun 2017 11:37:33 +0000 (13:37 +0200)]
input/csv: Fix a false negative after successful import

The input module runs receive() and end() invocations which end up
calling process_buffer(). It's perfectly legal to call the process
routine with an empty accumulation buffer, especially when the process
routine was called from end().

This fixes a condition where PulseView raised a fatal error at the end
of a completed successful import.

Reported-By: Sergey Alirzaev <redacted>
7 years agoinput/csv: Re-order processing steps (column mode vs text line split)
Gerhard Sittig [Mon, 5 Jun 2017 11:34:05 +0000 (13:34 +0200)]
input/csv: Re-order processing steps (column mode vs text line split)

Move an independent test for single/multi column operation out of a code
path that checked for and then processed text lines. This commit does
not change behaviour, but prepares a subsequent commit.

7 years agoinput/csv: Concentrate text line encoding in a single spot
Gerhard Sittig [Mon, 5 Jun 2017 11:09:16 +0000 (13:09 +0200)]
input/csv: Concentrate text line encoding in a single spot

Factor out a magic string literal which held a delimiter set yet could
be mistaken for an (assumed) fixed termination string. Concentrate the
determination of the end-of-line text encoding as well as the resulting
set of possible deliminters in one nearby location. The symbolic name
for the delimiter set eliminates the doubt on its purpose.

7 years agoinput/csv: Improve readability (bool expr vs assign, nested arrays)
Gerhard Sittig [Mon, 5 Jun 2017 11:02:31 +0000 (13:02 +0200)]
input/csv: Improve readability (bool expr vs assign, nested arrays)

Move variable assignments out of boolean condition checks. Factor out
repeated access to nested arrays. This shall improve readability.

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

7 years agoDrop trailing whitespace in various files.
Uwe Hermann [Tue, 6 Jun 2017 12:10:02 +0000 (14:10 +0200)]
Drop trailing whitespace in various files.

7 years agoMinor cosmetics.
Uwe Hermann [Tue, 6 Jun 2017 10:17:44 +0000 (12:17 +0200)]
Minor cosmetics.

7 years agouninstall: Remove empty libsigrok/libsigrokcxx include directories.
Uwe Hermann [Sat, 3 Jun 2017 16:25:54 +0000 (18:25 +0200)]
uninstall: Remove empty libsigrok/libsigrokcxx include directories.

Change uninstall-local to uninstall-hook, since the latter is guaranteed
to run last (order is apparently not guaranteed for uninstall-local).

This fixes bug #861.

7 years agoDemo: Convert white spaces to dashes for walking one/zero pattern
Soeren Apel [Sat, 27 May 2017 21:34:09 +0000 (23:34 +0200)]
Demo: Convert white spaces to dashes for walking one/zero pattern

7 years agoBindings: Provide helper method that auto-converts analog
Soeren Apel [Sat, 27 May 2017 20:37:09 +0000 (22:37 +0200)]
Bindings: Provide helper method that auto-converts analog

7 years agoBindings: Flesh out the analog payload bindings
Soeren Apel [Sat, 27 May 2017 14:54:53 +0000 (16:54 +0200)]
Bindings: Flesh out the analog payload bindings

7 years agoDemo: Add walking one/walking zero pattern
Soeren Apel [Wed, 24 May 2017 09:20:04 +0000 (11:20 +0200)]
Demo: Add walking one/walking zero pattern

7 years agoasix-sigma: Silence a compiler warning (declared but not used)
Gerhard Sittig [Fri, 26 May 2017 19:36:35 +0000 (21:36 +0200)]
asix-sigma: Silence a compiler warning (declared but not used)

The call site which referenced the variable was conditional (disabled
trigger support) but the variable declaration was not. Fix that.

7 years agoasix-sigma: Use monotonic time not wallclock time
Gerhard Sittig [Fri, 26 May 2017 17:36:01 +0000 (19:36 +0200)]
asix-sigma: Use monotonic time not wallclock time

Switch from gettimeofday() to g_get_monotonic_time() calls.

This commit is based on work done by jry@ (but with reduced diff size).

7 years agoasix-sigma: Handle sample memory wrap around (circular buffer)
Gerhard Sittig [Fri, 26 May 2017 01:06:39 +0000 (03:06 +0200)]
asix-sigma: Handle sample memory wrap around (circular buffer)

Handle the case when the sample data memory was filled and has wrapped
around during acquisition. Download the respective part of the data
which is reliably available, only skipping a single 1KB row which might
contain either old or new data while it's not certain which it would be.

This will be essential when triggers later become available. Right now
it copes with user requests for sample counts that exceed the total DRAM
capacity. Instead the maximum available amount of data is provided.

Of course acquisition no longer gets stopped when the end of DRAM is
reached.

7 years agoasix-sigma: Fixup the download of the last data acquisition chunk
Gerhard Sittig [Fri, 26 May 2017 00:18:33 +0000 (02:18 +0200)]
asix-sigma: Fixup the download of the last data acquisition chunk

Correctly determine the size of a download chunk for the last DRAM row
that's involved in the recent data acquisition.

This commit is based on work done by jry@.

This addresses bug #838 (trailing garbage).

It's assumed that the previously downloaded excess data was "swallowed"
by the sample count enforcement logic that was applied earlier, so the
(remainder of the) issue could have gone unnoticed, unless some other
termination condition than sample count was used.

7 years agoasix-sigma: Comment on RLE decompression upon data retrieval
Gerhard Sittig [Fri, 26 May 2017 00:16:28 +0000 (02:16 +0200)]
asix-sigma: Comment on RLE decompression upon data retrieval

Rephrase and shorten a comment on how RLE decompression works. Drop the
part of the comment which is not related to (de-)compression.

7 years agoasix-sigma: Remove an unused variable
Gerhard Sittig [Fri, 26 May 2017 00:11:05 +0000 (02:11 +0200)]
asix-sigma: Remove an unused variable

7 years agoasix-sigma: Adjust clock configuration upon acquisition start
Gerhard Sittig [Thu, 25 May 2017 23:30:42 +0000 (01:30 +0200)]
asix-sigma: Adjust clock configuration upon acquisition start

Configure the samplerate clock and channel count during acquisition
start in identical ways for 50MHz, 100MHz, and 200MHz modes.

This part was inspired by work done by jry@ yet was addressed in
different ways (no exception, do everything in every mode the same way).

Eliminate a portability issue in the previous implementation. Make sure
to send the configuration bytes in the correct order to the hardware.
Don't typecase a struct reference to a bytepointer and hope that the
internal memory representation might fit the external hardware's idea.

7 years agoasix-sigma: Document the sample memory layout
Gerhard Sittig [Thu, 25 May 2017 22:31:21 +0000 (00:31 +0200)]
asix-sigma: Document the sample memory layout

Add a comment about sample memory organization in a central spot. This
concentrates knowledge which otherwise would be spread across several
locations all over the driver's codebase, yet is essential to have at
hand during maintenance.

All of the information was determined/updated by jry@ with the help of
Ondrej at Asix when he did lots of fixes and improvements to asix-sigma.

7 years agoasix-sigma: Enforce optionally specified sample count
Gerhard Sittig [Thu, 25 May 2017 21:43:04 +0000 (23:43 +0200)]
asix-sigma: Enforce optionally specified sample count

The Asix Sigma hardware does not support a sample count limit. Instead
this optional input parameter gets mapped to a sample time, and some
slack for hardware pipelines and compression gets added. When data
acquisition completes and sample data gets downloaded, chances are that
there is more data than requested by the user.

Do enforce the optional sample count limit. Stop sending data to the
sigrok session when the configured number of samples was sent.

This commit is based on work done by jry@.

This fixes bug #838.

7 years agoasix-sigma: Acquisition stop, symbolic identifiers for mode register fields
Gerhard Sittig [Thu, 25 May 2017 20:55:00 +0000 (22:55 +0200)]
asix-sigma: Acquisition stop, symbolic identifiers for mode register fields

Enhance how the data acquisition is stopped. Wait for the hardware to
flag the successful completion of data retrieval as well as flushing
through hardware pipelines.

Use symbolic identifiers for the mode register's fields (for read as
well as write access).

This commit uses part of a code update to better match the documentation
done by jry@, but not all of it to reduce the size of the commit.

7 years agoasix-sigma: Nit, separate declaration from assignment statements
Gerhard Sittig [Thu, 25 May 2017 20:09:54 +0000 (22:09 +0200)]
asix-sigma: Nit, separate declaration from assignment statements

Minor adjustment for improved readability. Don't hide assignments in
variable declarations. Move initialization of some variables closer to
related evaluation or subsequent processing. Break a complicated looking
roundup expression into several short steps.

7 years agoasix-sigma: Fix a register addressing bug (non-issue)
Gerhard Sittig [Thu, 25 May 2017 19:57:30 +0000 (21:57 +0200)]
asix-sigma: Fix a register addressing bug (non-issue)

Fix how the READ_ID register index was passed to the hardware access.
Addresses are sent in nibbles, so shift by eight is wrong here. No harm
was done, as the register's index is zero.

7 years agoasix-sigma: Only download firmware when necessary
Gerhard Sittig [Thu, 25 May 2017 17:47:31 +0000 (19:47 +0200)]
asix-sigma: Only download firmware when necessary

The Asix Sigma driver is aware of three firmware images, which are
required for acquisition with up to 50MHz, 100MHz, and 200MHz. The
previous implementation always downloaded the corresponding firmware
image whenever the sample rate has changed, which was redundant.

Skip the download when the new samplerate uses the same firmware as the
previously selected samplerate did. This results in faster responses in
the GUI when the samplerate selection changes.

Move assignments out of the variable declaration block for improved
readability while we are here.

7 years agoasix-sigma: Properly decode data gathered at 100 and 200 MHz
Gerhard Sittig [Sun, 23 Apr 2017 14:51:31 +0000 (16:51 +0200)]
asix-sigma: Properly decode data gathered at 100 and 200 MHz

The hardware provides captured data at a maximum rate of 16bits per 20ns
(50 MHz). For samplerates of 100 and 200 MHz one individual 16bit entity
contains multiple samples for a reduced number of channels. The bits of
several sample points are interleaved within the 16bit entity.

This commit is based on work done by jry@ who fixed a lot of issues with
the help from Ondrej at Asix.

This fixes bug #840.

7 years agoasix-sigma: Stabilize channel assignment for different samplerates
Gerhard Sittig [Thu, 25 May 2017 23:34:55 +0000 (01:34 +0200)]
asix-sigma: Stabilize channel assignment for different samplerates

Adjust the interpretation of acquired sample data such that regardless
of 50/100/200MHz samplerate the assignment of LA pins to sigrok channels
remains stable.

7 years agoasix-sigma: Factor out access to sample data and session data
Gerhard Sittig [Sun, 23 Apr 2017 12:15:57 +0000 (14:15 +0200)]
asix-sigma: Factor out access to sample data and session data

Introduce helper routines to access the sample data that is provided by
the ASIX hardware, as well as the buffer which accumulates logic data
before it gets sent to the session's datafeed.

This hides endianess issues from call sites, and prepares access to
memory layout which varies with sample frequencies.

This commit is based on work done by jry@.

7 years agoasix-sigma: Disable support for triggers, they don't work right now
Gerhard Sittig [Thu, 25 May 2017 17:06:36 +0000 (19:06 +0200)]
asix-sigma: Disable support for triggers, they don't work right now

This works around bug #359. Triggers currently are not operational for
Asix Sigma. Don't claim support in the driver so that UIs won't use the
feature. Yet allow research in this issue, by concentrating the switch
for the feature's support in a central location.

Add/update a comment and unobfuscate an error code path while we are here.

7 years agoasix-sigma: Nit, remove redundant USB VID/PID declaration
Gerhard Sittig [Thu, 25 May 2017 11:31:46 +0000 (13:31 +0200)]
asix-sigma: Nit, remove redundant USB VID/PID declaration

Both the .c and the .h file declared the same identifiers for USB
properties of ASIX hardware with identical values. Remove the .c
incarnation and keep the .h content, as the names are used in api.c
as well as protocol.c sources.

7 years agoasix-sigma: Improve sample time estimation, consider hardware pipeline
Gerhard Sittig [Sun, 23 Apr 2017 16:20:44 +0000 (18:20 +0200)]
asix-sigma: Improve sample time estimation, consider hardware pipeline

Introduce a separate routine which maps sample counts and sample period
to an elapsed sample time after which acquisition shall get stopped.
Add some more time to make sure the most recent captured data has passed
the hardware pipeline and is available for download.

This commit is based on work done by jry@.

7 years agoasix-sigma: Fixed RLE decoder
Gerhard Sittig [Sun, 23 Apr 2017 11:29:51 +0000 (13:29 +0200)]
asix-sigma: Fixed RLE decoder

When "tsdiff < EVENTS_PER_CLUSTER" we don't want "tsdiff - EVENTS_PER_CLUSTER"
(a negative number) to be treated as (int).

Submitted-By: jry <redacted>
[ gsi: massaged for mainline submission ]

7 years agoAdd APIs to query libsigrok build information.
Uwe Hermann [Wed, 24 May 2017 18:05:03 +0000 (20:05 +0200)]
Add APIs to query libsigrok build information.

7 years agoserial-dmm: Use a custom dummy struct for m2110.
Uwe Hermann [Wed, 24 May 2017 17:04:17 +0000 (19:04 +0200)]
serial-dmm: Use a custom dummy struct for m2110.

This DMM/parser is not related to metex14, don't use that struct.

7 years agouni-t-dmm: Fix incorrect Tenma 72-7745 list entry.
Uwe Hermann [Tue, 23 May 2017 23:34:06 +0000 (01:34 +0200)]
uni-t-dmm: Fix incorrect Tenma 72-7745 list entry.

This is a regression from f05406117d67de3bd8aa5f904573bdd5d7ba401f.

7 years agouni-t-dmm: Add missing special cases for some ES519xx protocols.
Uwe Hermann [Tue, 23 May 2017 23:29:28 +0000 (01:29 +0200)]
uni-t-dmm: Add missing special cases for some ES519xx protocols.

7 years agofx2lafw: Always enable wide sampling for dslogic firmware
Angus Gratton [Wed, 12 Apr 2017 07:26:45 +0000 (17:26 +1000)]
fx2lafw: Always enable wide sampling for dslogic firmware

Fixes regression in 8399f68a3.

Ref: https://sourceforge.net/p/sigrok/mailman/message/35780588/

Signed-off-by: Angus Gratton <redacted>
7 years agout71x: Fix incorrect resistance values on some DMMs.
Uwe Hermann [Tue, 23 May 2017 05:44:42 +0000 (07:44 +0200)]
ut71x: Fix incorrect resistance values on some DMMs.

The resistance values of some DMMs were incorrectly reported due to a
missing factor of 10 in the calculations.

Tested on Voltcraft VC-920/VC-940 and Tenma 72-9380A/72-7730/72-7732.

7 years agodemo: Retain the default of 8 digital channels for now.
Uwe Hermann [Sun, 21 May 2017 16:35:21 +0000 (18:35 +0200)]
demo: Retain the default of 8 digital channels for now.

7 years agodemo: support up to 128 logic channels, enable the lower 8 by default
Gerhard Sittig [Fri, 5 May 2017 21:20:43 +0000 (23:20 +0200)]
demo: support up to 128 logic channels, enable the lower 8 by default

Bump the number of supported logic channels from 8 to 128. This is
mostly motivated to test the 64 channels limit which some of the
components/subprojects of the sigrok project might have (input/output
modules, user interfaces).

Only automatically enable the first 8 of the 128 total logic channels,
i.e. default to the previous behaviour. Prepare to only enable part of
the set of analog channels, but stick with their being active by default
as well.

Factor out the choice for the default logic pattern, too. This allows
for easier adjustment of the default configuration, when settings are
concentrated in a single spot.

7 years agodemo: add "cable squid" logic waveform (works-with logo, many channels)
Gerhard Sittig [Fri, 5 May 2017 20:35:38 +0000 (22:35 +0200)]
demo: add "cable squid" logic waveform (works-with logo, many channels)

Extend the demo driver, add another waveform choice for logic channels.
Create a "cable squid" logo representation which occupies a large number
of channels.

This pattern occupies 128x128 pixels. Unlike the 'sigrok' pattern it
gets repeated when more channels are involved, but is not shifted in the
repetition.

7 years agout71x: Fix float printing issue in a debug message.
Uwe Hermann [Sun, 21 May 2017 14:34:41 +0000 (16:34 +0200)]
ut71x: Fix float printing issue in a debug message.

Old:
ut71x: Applying exponent -12, new value is 0.000000.
P1: 1.500 nF AUTO
P1: 1.500 nF AUTO

New:
ut71x: Applying exponent -12, new value is 1.5e-09.
P1: 1.500 nF AUTO
P1: 1.500 nF AUTO

This fixes bug #700.

7 years agoVirtual session: Workaround for SR_CONF_CAPTUREFILE (#944)
Soeren Apel [Sun, 21 May 2017 15:10:38 +0000 (17:10 +0200)]
Virtual session: Workaround for SR_CONF_CAPTUREFILE (#944)

This is a (hopefully temporary) workaround for the
SR_CONF_CAPTUREFILE mechanism. The value for
vdev->capturefile is set by this, however only once
via stream_session_data().
During stream processing in stream_session_data(),
capturefile may receive new values - e.g. when there
are multiple logic files or if there is analog data.
With that, the initially set capturefile is overwritten.

When re-loading the file, we are then running into
issues because we don't know what the initial value was.
As all .sr files use "logic-1" by default and, we
simulate the behavior of stream_session_data() and
assign this name to capturefile if there are logic
channels present.

With this change, all three kinds of files reload
as expected: logic only, analog only and mixed signal.
For this reason, it's a short-term fix for #944.

7 years agoVirtual session: rename num_channels to num_logic_channels
Soeren Apel [Sun, 21 May 2017 07:20:42 +0000 (09:20 +0200)]
Virtual session: rename num_channels to num_logic_channels

7 years agohantek-6xxx: Only list DC coupling once.
Uwe Hermann [Tue, 16 May 2017 23:07:56 +0000 (01:07 +0200)]
hantek-6xxx: Only list DC coupling once.

Avoid incorrect indexing and the follow-up segfault.

This fixes bug #822.

7 years agorigol-ds: Handle digital channels correctly for MSO2000A series.
Martin Ling [Tue, 16 May 2017 23:04:07 +0000 (00:04 +0100)]
rigol-ds: Handle digital channels correctly for MSO2000A series.

The handling of the digital channels for this series is somewhere
between that of the DS1000D series (PROTOCOL_V2) and the MSO1000Z
(PROTOCOL_V4).

The :LA command set is similar to that of V4, but the LA data has to be
requested with :WAV:SOUR:LA and arrives in interleaved form like V2.

None of these changes should affect other models. They only affect the
case of PROTOCOL_V3 with digital channels, which occurs only for the
MSO2000A series.

7 years agohantek-6xxx: Fix coupling selection.
Uwe Hermann [Tue, 16 May 2017 20:23:24 +0000 (22:23 +0200)]
hantek-6xxx: Fix coupling selection.

Due to an uninitialized variable, switching to/from AC/DC coupling
(on models that support this) was not working.

This fixes bug #836.

7 years agorigol-ds: Add model entries for MSO2000A series.
Martin Ling [Mon, 15 May 2017 15:16:00 +0000 (16:16 +0100)]
rigol-ds: Add model entries for MSO2000A series.

This should be sufficient to fully support these models, unless there
are protocol differences for the digital channels.

This fixes bug #778.

7 years agooutput/csv: get proper index for input channels
Wolfram Sang [Thu, 11 May 2017 11:51:10 +0000 (13:51 +0200)]
output/csv: get proper index for input channels

'j' is the loop variable for channels, not 'ch'.

This fixes parts of bug #844.

Signed-off-by: Wolfram Sang <redacted>
7 years agooutput/csv: fix a minor leak
Wolfram Sang [Thu, 11 May 2017 11:51:09 +0000 (13:51 +0200)]
output/csv: fix a minor leak

Signed-off-by: Wolfram Sang <redacted>
7 years agooutput/csv: fix segfault with logic channels
Wolfram Sang [Thu, 11 May 2017 11:51:08 +0000 (13:51 +0200)]
output/csv: fix segfault with logic channels

'i' was iterating in steps of unitsize. However, the destination array
was also indexed with it, but it is of u8 type. Let 'i' run bytewise and
only multiply with unitsize when we need it.

This fixes parts of bug #844.

Signed-off-by: Wolfram Sang <redacted>
7 years agooutput/csv: fix segfault when naming logic channels
Wolfram Sang [Thu, 11 May 2017 11:51:07 +0000 (13:51 +0200)]
output/csv: fix segfault when naming logic channels

'j' is the loop variable for channels, not 'i'.

This fixes parts of bug #844.

Reported-by: Maxim Sloyko <redacted>
Signed-off-by: Wolfram Sang <redacted>
7 years agooutput/csv: Fix a compiler warning.
Uwe Hermann [Sat, 18 Mar 2017 19:55:20 +0000 (20:55 +0100)]
output/csv: Fix a compiler warning.

src/output/csv.c: In function 'dump_saved_values':
src/output/csv.c:461:6: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
      ctx->sample_time, ctx->value);
      ^

7 years agorigol-ds: Send *OPC? after commands that don't return a value.
Martin Ling [Tue, 9 May 2017 23:33:58 +0000 (00:33 +0100)]
rigol-ds: Send *OPC? after commands that don't return a value.

Fixes #933.

We'd already had this problem elsewhere and thus have this wrapper function
that does this where necessary. It just wasn't in use on these two call sites,
which was causing timing problems when used over tcp-raw or VXI transports.

7 years agohameg-hmo: Add support for Hameg HMO3524
Johannes Römer [Sun, 7 May 2017 15:21:47 +0000 (17:21 +0200)]
hameg-hmo: Add support for Hameg HMO3524

7 years agooutput/vcd: minor nit, remove unused variable
Gerhard Sittig [Sun, 16 Apr 2017 14:47:03 +0000 (16:47 +0200)]
output/vcd: minor nit, remove unused variable

7 years agominor nit, fixup whitespace in libsigrok.h
Gerhard Sittig [Sun, 16 Apr 2017 15:17:27 +0000 (17:17 +0200)]
minor nit, fixup whitespace in libsigrok.h

7 years agoDe-init vdev->capturefile when done
Soeren Apel [Thu, 4 May 2017 16:40:39 +0000 (18:40 +0200)]
De-init vdev->capturefile when done

Without doing this, re-reading the input file
results in a segfault as the internal state
machine becomes confused.

7 years agoopenbench-logic-sniffer: fix acquisition restart with trigger enabled
Gwenhael Goavec-Merou [Sun, 30 Apr 2017 13:57:40 +0000 (15:57 +0200)]
openbench-logic-sniffer: fix acquisition restart with trigger enabled

With trigger enabled, and with PulseView, a second (or more) acquisition
starts immediately instead of blocking. It's mandatory to try several times
to have a correct behavior.

According to http://mygizmos.org/ols/Logic-Sniffer-FPGA-Spec.pdf section 2.3.1
p.8, the Openbench Logic Sniffer must be reset before each arm command.

This fixes bug #809.

Signed-off-by: Gwenhael Goavec-Merou <redacted>
7 years agoopenbench-logic-sniffer: add a function to handle reset command
Gwenhael Goavec-Merou [Sun, 30 Apr 2017 13:57:39 +0000 (15:57 +0200)]
openbench-logic-sniffer: add a function to handle reset command

Openbench Logic Sniffer reset is a little more complex than a simple send.
To avoid code duplication, this patch adds a new function dedicated to
this task.

Signed-off-by: Gwenhael Goavec-Merou <redacted>
7 years agoREADME: Fix incorrect gcc/clang minimum versions.
Uwe Hermann [Fri, 31 Mar 2017 17:47:18 +0000 (19:47 +0200)]
README: Fix incorrect gcc/clang minimum versions.

https://gcc.gnu.org/projects/cxx-status.html#cxx11
https://clang.llvm.org/cxx_status.html

7 years agoscpi-pps: Add initial support for R&S HMC8043
Marc Schink [Wed, 29 Mar 2017 16:33:36 +0000 (18:33 +0200)]
scpi-pps: Add initial support for R&S HMC8043

7 years agocontrib/z60_libsigrok.rules: Use 660 permissions.
Uwe Hermann [Mon, 27 Mar 2017 06:55:17 +0000 (08:55 +0200)]
contrib/z60_libsigrok.rules: Use 660 permissions.

It doesn't really make sense to allow anyone to read (but not write)
USB devices.

This fixes parts of bug #665.

7 years agocontrib/udev: add note on required name for systemd
Karl Palsson [Wed, 1 Mar 2017 21:11:57 +0000 (21:11 +0000)]
contrib/udev: add note on required name for systemd

Systemd needs the file to be numbered the right way, document this
properly.

See also:
https://lists.debian.org/debian-devel-announce/2016/11/msg00008.html
http://openocd.zylin.com/2804

This fixes parts of bug #665.

Signed-off-by: Karl Palsson <redacted>
7 years agocontrib/udev: add TAG+="uaccess" for systemd
Karl Palsson [Wed, 1 Mar 2017 21:09:35 +0000 (21:09 +0000)]
contrib/udev: add TAG+="uaccess" for systemd

Instead of replacing the group=plugdev, simply add the TAG as well.
This allows (in most cases) the same file to be used happily on systemd
and older group based systems. Some systems may produce warnings about
non-existant groups, but it remains functional. Approach inspired by
that taken by the OpenOCD project.

This fixes parts of bug #665.

Signed-off-by: Karl Palsson <redacted>
7 years agouni-t-ut32x: Accept SR_CONF_CONN, fixing scan.
Bert Vermeulen [Tue, 21 Mar 2017 19:45:46 +0000 (20:45 +0100)]
uni-t-ut32x: Accept SR_CONF_CONN, fixing scan.

7 years agosession_driver.c: Increase chunk size for slightly better performance.
Uwe Hermann [Thu, 16 Mar 2017 22:59:58 +0000 (23:59 +0100)]
session_driver.c: Increase chunk size for slightly better performance.

Increasing the chunk size from 512ksamples to 4Msamples leads to
slightly faster session file loading from sigrok session (*.sr) files
in frontends, while not looking too "chunky".

The performance increase is not really massive, but still noticeable.
A further increase to, say, 10 or 100Msamples shows no further
noticeable improvements.

7 years agofx2lafw: Only sample/send analog data if analog channels are enabled.
Uwe Hermann [Wed, 15 Mar 2017 01:31:09 +0000 (02:31 +0100)]
fx2lafw: Only sample/send analog data if analog channels are enabled.

7 years agofx2lafw: Drop unused devc->ch_enabled.
Uwe Hermann [Wed, 15 Mar 2017 00:45:27 +0000 (01:45 +0100)]
fx2lafw: Drop unused devc->ch_enabled.

7 years agofx2lafw: Use wide_sampling only if necessary.
Jan Losinski [Thu, 12 Jan 2017 03:45:08 +0000 (04:45 +0100)]
fx2lafw: Use wide_sampling only if necessary.

This changes the fx2lafw code to only enable the wide_sampling (16bit)
method, if at least one of the higher eight channels is enabled. This
has the benefit, that we can use higher samplerates on 16bit LA
devices if we use only the first eight channels.

The wide sampling is also enabled if we have one or more analog
channels.

Signed-off-by: Jan Losinski <redacted>
7 years agoSCPI: add sr_scpi_write_data()
Sven Schnelle [Mon, 13 Feb 2017 17:48:52 +0000 (18:48 +0100)]
SCPI: add sr_scpi_write_data()

Can be used to send raw data on a SCPI connection.

Signed-off-by: Sven Schnelle <redacted>
7 years agoFix obsolete code comments.
Uwe Hermann [Fri, 10 Mar 2017 06:37:05 +0000 (07:37 +0100)]
Fix obsolete code comments.

"Probe groups" are called "channel groups" now.

7 years agosr_scpi_free(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:47:54 +0000 (19:47 +0100)]
sr_scpi_free(): Allow NULL as argument.

7 years agosr_scpi_hw_info_free(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:45:23 +0000 (19:45 +0100)]
sr_scpi_hw_info_free(): Allow NULL as argument.

7 years agosr_usbtmc_dev_inst_free(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:33:18 +0000 (19:33 +0100)]
sr_usbtmc_dev_inst_free(): Allow NULL as argument.

7 years agosr_usb_dev_inst_new(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:31:22 +0000 (19:31 +0100)]
sr_usb_dev_inst_new(): Allow NULL as argument.

(documentation fix, the function always handled NULL fine)

7 years agosr_serial_dev_inst_free(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:27:25 +0000 (19:27 +0100)]
sr_serial_dev_inst_free(): Allow NULL as argument.

7 years agosr_dev_inst_free(): Allow NULL as argument.
Uwe Hermann [Wed, 8 Mar 2017 18:18:17 +0000 (19:18 +0100)]
sr_dev_inst_free(): Allow NULL as argument.