]> sigrok.org Git - libsigrok.git/log
libsigrok.git
6 years agodrivers: Provide proper drvopts.
Uwe Hermann [Tue, 18 Jul 2017 22:03:39 +0000 (00:03 +0200)]
drivers: Provide proper drvopts.

The device class config keys should be in drvopts (not devopts).

6 years agodrivers: Always use same scanopts/drvopts/devopts/devopts_cg* order.
Uwe Hermann [Tue, 18 Jul 2017 20:12:54 +0000 (22:12 +0200)]
drivers: Always use same scanopts/drvopts/devopts/devopts_cg* order.

6 years agodrivers: Add and use STD_CONFIG_LIST().
Uwe Hermann [Thu, 13 Jul 2017 19:14:04 +0000 (21:14 +0200)]
drivers: Add and use STD_CONFIG_LIST().

This ensures consistent handling of the SR_CONF_SCAN_OPTIONS and
SR_CONF_DEVICE_OPTIONS (with sdi NULL or non-NULL) config keys
and also reduces copy-pasted boilerplate in the drivers a bit.

This function does not handle channel-group specific items, that's
very driver-specific and thus left to the individual drivers.

Also move some generic checks and error messages from the drivers into
the sr_config_list() wrapper.

6 years agosaleae-logic-pro: Use sr_dev_acquisition_stop() wrapper.
Uwe Hermann [Mon, 17 Jul 2017 06:25:27 +0000 (08:25 +0200)]
saleae-logic-pro: Use sr_dev_acquisition_stop() wrapper.

6 years agosaleae-logic-pro: Detect and abort on capture errors
Jan Luebbe [Sun, 16 Jul 2017 17:28:58 +0000 (19:28 +0200)]
saleae-logic-pro: Detect and abort on capture errors

The HW simply stops sending data on overflows, so if we receive no data
in one second, we abort the acquisition. We also need to allocate more
buffers to support higher sample rates.

6 years agosaleae-logic-pro: Implement bitstream upload and initialization
Jan Luebbe [Sun, 16 Jul 2017 17:25:46 +0000 (19:25 +0200)]
saleae-logic-pro: Implement bitstream upload and initialization

The control packets can be longer than 256 bytes, so change the
low-level functions accordingly.

6 years agosaleae-logic-pro: Implement FX3 firmware upload
Jan Luebbe [Sun, 16 Jul 2017 17:24:27 +0000 (19:24 +0200)]
saleae-logic-pro: Implement FX3 firmware upload

6 years agodrivers: Remove some uneeded 'ret' variables.
Uwe Hermann [Wed, 12 Jul 2017 20:03:37 +0000 (22:03 +0200)]
drivers: Remove some uneeded 'ret' variables.

6 years agosession_driver: Use std_cleanup().
Uwe Hermann [Tue, 11 Jul 2017 19:34:18 +0000 (21:34 +0200)]
session_driver: Use std_cleanup().

6 years agosession_driver: Don't open-code std_dev_clear().
Uwe Hermann [Tue, 11 Jul 2017 19:32:03 +0000 (21:32 +0200)]
session_driver: Don't open-code std_dev_clear().

6 years agoclear_helper(): Use a cast to shorten all implementations.
Uwe Hermann [Tue, 11 Jul 2017 19:30:30 +0000 (21:30 +0200)]
clear_helper(): Use a cast to shorten all implementations.

6 years agosr_dev_clear(): Always free sdi->priv (devc).
Uwe Hermann [Tue, 11 Jul 2017 20:59:52 +0000 (22:59 +0200)]
sr_dev_clear(): Always free sdi->priv (devc).

Until now, clear_helper() callbacks for std_dev_clear_with_callback()
were expected to g_free(devc), but not all of them did that.

Have std_dev_clear_with_callback() unconditionally g_free(sdi->priv)
(i.e., devc), regardless of whether a clear_helper() callback was
provided or not. It was doing g_free(sdi->priv) when no callback
was provided already anyway.

This makes the individual drivers' clear_helper() implementations
shorter and prevents errors such as missing g_free(devc) calls.

This works, because all drivers either call std_dev_clear_with_callback()
directly, or indirectly via std_dev_clear().

This also allows us to remove some no-longer needed dev_clear()
and clear_helper() implementations that only did g_free(devc)
in favor of std_dev_clear().

6 years agodev_clear(): Consistently name callback 'clear_helper()'.
Uwe Hermann [Tue, 11 Jul 2017 20:47:46 +0000 (22:47 +0200)]
dev_clear(): Consistently name callback 'clear_helper()'.

6 years agostd: Add and use std_dev_clear() where possible.
Uwe Hermann [Tue, 11 Jul 2017 20:14:01 +0000 (22:14 +0200)]
std: Add and use std_dev_clear() where possible.

Be explicit and consistent in the drivers about which dev_clear function
will be called to avoid confusion and inconsistencies.

Drop some open-coded implementations of std_dev_clear().

6 years agostd: Rename std_dev_clear() to std_dev_clear_with_callback().
Uwe Hermann [Tue, 11 Jul 2017 19:48:00 +0000 (21:48 +0200)]
std: Rename std_dev_clear() to std_dev_clear_with_callback().

6 years agostd: Factor out some API call dummy implementations.
Uwe Hermann [Tue, 11 Jul 2017 19:21:00 +0000 (21:21 +0200)]
std: Factor out some API call dummy implementations.

6 years agoVarious log message cleanups.
Uwe Hermann [Tue, 11 Jul 2017 19:06:15 +0000 (21:06 +0200)]
Various log message cleanups.

Drop unneeded log messages, add some others that might be useful,
document which ones we're intentionally not emitting.

Don't log "$operation successful" type of messages in most cases,
that's too verbose; logging failures only is sufficient there.

baylibre-acme: Don't log "No such file or directory" messages during scan,
this triggers on all kinds of unrelated devices (e.g. "AMDGPU i2c bit
bus 0x91" in this case):

  sr: [...] baylibre-acme: Name for probe 1 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0040/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 2 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0041/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 3 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0044/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 4 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0045/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0042/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 5 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004c/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0043/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 6 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0049/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0046/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 7 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004f/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-0047/name”: No such file or directory
  sr: [...] baylibre-acme: Name for probe 8 can't be read: Failed to open file “/sys/class/i2c-adapter/i2c-1/1-004b/name”: No such file or directory

6 years agostd: Simplifications, random fixes, Doxygen cosmetics.
Uwe Hermann [Mon, 10 Jul 2017 20:32:26 +0000 (22:32 +0200)]
std: Simplifications, random fixes, Doxygen cosmetics.

 - sr_dev_clear(): Don't try to clear uninitialized drivers (the same
   check was previously done in std_dev_clear()).

 - Document some places where we intentionally don't emit log messages.

 - std: Various Doxygen fixes and updates.

 - std: Add some more sanity-checks on input parameters.

6 years agosession_file: Start out with SR_ST_INACTIVE like all drivers.
Uwe Hermann [Fri, 7 Jul 2017 21:34:34 +0000 (23:34 +0200)]
session_file: Start out with SR_ST_INACTIVE like all drivers.

6 years agosr_dev_close(): Set status to SR_ST_INACTIVE.
Uwe Hermann [Fri, 7 Jul 2017 18:42:04 +0000 (20:42 +0200)]
sr_dev_close(): Set status to SR_ST_INACTIVE.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_open(): Set status to SR_ST_ACTIVE upon success.
Uwe Hermann [Fri, 7 Jul 2017 20:36:24 +0000 (22:36 +0200)]
sr_dev_open(): Set status to SR_ST_ACTIVE upon success.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_open(): Factor out SR_ST_ACTIVE check.
Uwe Hermann [Fri, 7 Jul 2017 19:11:56 +0000 (21:11 +0200)]
sr_dev_open(): Factor out SR_ST_ACTIVE check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:24:12 +0000 (20:24 +0200)]
sr_dev_close(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_config_commit(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:17:50 +0000 (20:17 +0200)]
sr_config_commit(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agosr_config_set(): Factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Thu, 6 Jul 2017 18:05:43 +0000 (20:05 +0200)]
sr_config_set(): Factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoAdd sr_dev_acquisition_start(), factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Wed, 5 Jul 2017 20:37:10 +0000 (22:37 +0200)]
Add sr_dev_acquisition_start(), factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoAdd sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.
Uwe Hermann [Wed, 5 Jul 2017 17:33:38 +0000 (19:33 +0200)]
Add sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.

This ensures consistent checks and log messages across all drivers
and reduces the per-driver boilerplate.

6 years agoIntroduce A2L methods
Soeren Apel [Sat, 1 Jul 2017 22:55:03 +0000 (00:55 +0200)]
Introduce A2L methods

The memory allocation for sr_datafeed_logic is broken, the memory
will never be freed. #994 is used to handle this issue.

6 years agoBindings: constify data pointer
Soeren Apel [Sat, 1 Jul 2017 21:57:34 +0000 (23:57 +0200)]
Bindings: constify data pointer

6 years agogitignore nano and vim swap files
Roland Hieber [Mon, 3 Jul 2017 21:02:48 +0000 (23:02 +0200)]
gitignore nano and vim swap files

When .*.swp already exists, vim will try .*.swo, then .*.swn, and so
forth. Ignore those files too.

Signed-off-by: Roland Hieber <redacted>
6 years agoserial-dmm: Add support for the SparkFun 70C multimeter.
Richard [Wed, 28 Jun 2017 05:23:35 +0000 (00:23 -0500)]
serial-dmm: Add support for the SparkFun 70C multimeter.

6 years agoMark some arrays as const
Richard [Wed, 28 Jun 2017 05:22:46 +0000 (00:22 -0500)]
Mark some arrays as const

6 years agosaleae-logic-pro: Fix two compiler warnings.
Uwe Hermann [Mon, 3 Jul 2017 06:40:30 +0000 (08:40 +0200)]
saleae-logic-pro: Fix two compiler warnings.

  src/hardware/saleae-logic-pro/protocol.c:389:12: warning: 'set_led' defined but not used [-Wunused-function]
   static int set_led(const struct sr_dev_inst *sdi, uint8_t r, uint8_t g, uint8_t b)
              ^
    CC       src/hardware/saleae-logic-pro/api.lo
  src/hardware/saleae-logic-pro/api.c: In function 'dev_acquisition_handle':
  src/hardware/saleae-logic-pro/api.c:332:9: warning: missing initializer for field 'tv_sec' of 'struct timeval' [-Wmissing-field-initializers]
    struct timeval tv = {};
           ^
  In file included from /usr/include/x86_64-linux-gnu/sys/time.h:27:0,
                   from include/libsigrok/libsigrok.h:24,
                   from src/hardware/saleae-logic-pro/protocol.h:25,
                   from src/hardware/saleae-logic-pro/api.c:23:
  /usr/include/x86_64-linux-gnu/bits/time.h:32:14: note: 'tv_sec' declared here
       __time_t tv_sec;  /* Seconds.  */
                ^

6 years agoRevert "C++: Avoid std::map::emplace() for GCC 4.7 compatibility"
Uwe Hermann [Wed, 28 Jun 2017 06:54:57 +0000 (08:54 +0200)]
Revert "C++: Avoid std::map::emplace() for GCC 4.7 compatibility"

This reverts commit 8c529898116e9a6bf7083fb3b748b24d006392a4.

We now require g++ >= 4.8.1 which supports std::map::emplace(), as does
clang >= 3.3.

6 years agosaleae-logic-pro: Random minor cosmetics/consistency fixes.
Uwe Hermann [Wed, 28 Jun 2017 06:29:04 +0000 (08:29 +0200)]
saleae-logic-pro: Random minor cosmetics/consistency fixes.

6 years agosaleae-logic-pro: Driver name consistency fixes.
Uwe Hermann [Wed, 28 Jun 2017 06:15:24 +0000 (08:15 +0200)]
saleae-logic-pro: Driver name consistency fixes.

6 years agosaleae-logicpro: Initial implementation.
Jan Luebbe [Sun, 25 Jun 2017 18:38:05 +0000 (20:38 +0200)]
saleae-logicpro: Initial implementation.

The driver currently support only digital channels and a limited set of
sample rates.

6 years agosaleae-logicpro: Initial driver skeleton.
Jan Luebbe [Sun, 25 Jun 2017 18:37:57 +0000 (20:37 +0200)]
saleae-logicpro: Initial driver skeleton.

6 years agoasix-sigma: Only open the USB device once (fails with newer libftdi)
Gerhard Sittig [Sun, 25 Jun 2017 10:24:13 +0000 (12:24 +0200)]
asix-sigma: Only open the USB device once (fails with newer libftdi)

The asix-sigma driver was reported to fail in combination with newer
libftdi versions, because the firmware upload routine opened again an
already opened device, and then failed to claim the interface. Which was
not fatal before with previous libftdi versions.

Remove the redundant open call. Remove the local FTDI context variable,
which brings the firmware upload routine in line with all other calls
that communicate to the USB device.

This fixes bug #471.

Suggested-By: Marian Cingel <redacted>
6 years agoasix-sigma: Only change number of channels after successful firmware upload
Gerhard Sittig [Sun, 25 Jun 2017 10:11:03 +0000 (12:11 +0200)]
asix-sigma: Only change number of channels after successful firmware upload

The asix-sigma driver supports different samplerates, which will involve
different firmware images and will affect the number of available logic
channels as well as their memory layout in downloaded sample data.

Make sure to only store the configuration's parameters after the setup
of that configuration has successfully completed, and make sure to store
a consistent set of parameters. Specifically don't change the number of
channels when the firmware upload failed.

This fixes part of bug #471.

Suggested-By: Marian Cingel <redacted>
6 years agoasix-sigma: Propagate errors from firmware upload
Gerhard Sittig [Sun, 25 Jun 2017 10:01:43 +0000 (12:01 +0200)]
asix-sigma: Propagate errors from firmware upload

The firmware upload code paths in the asix-sigma driver used to return
either the SR_OK code, or the magic number 0 for error conditions. Which
happens to be identical and cannot be told apart by callers.

Provide proper SR_ERR return codes for error conditions, such that
callers can tell whether the firmware upload succeeded.

This fixes part of bug #471.

Suggested-By: Marian Cingel <redacted>
6 years agostrutil: Assume bool is true when no value is specified
Gerhard Sittig [Sun, 25 Jun 2017 09:28:29 +0000 (11:28 +0200)]
strutil: Assume bool is true when no value is specified

Adjust the string to boolean conversion for an edge case. Accept empty
text (either NULL or empty strings) to mean true instead of false.

This behaviour is more useful from the user's point of view, when the
option's name alone will enable a feature, and an explicit "option=yes"
specification is not strictly necessary. All calling applications in
mainline already implemented this semantics.

6 years agoC++ binding: Nits, style cleanup (braces, whitespace)
Gerhard Sittig [Sun, 11 Jun 2017 07:51:59 +0000 (09:51 +0200)]
C++ binding: Nits, style cleanup (braces, whitespace)

6 years agoC++ binding: Allow to re-use ConfigKey::parse_string() for Option class
Gerhard Sittig [Sun, 11 Jun 2017 07:54:52 +0000 (09:54 +0200)]
C++ binding: Allow to re-use ConfigKey::parse_string() for Option class

Split the data type detection from the actual data type conversion in
the ConfigKey::parse_string() method. Allow the Option class to re-use
the public ConfigKey method, to share the maximum amount of data type
conversion code for both Driver and InputFormat option specs.

This is the least intrusive yet most reliable and consistent approach in
the libsigrok C++ binding that allows applications to support driver scan
and input file format options from command line arguments.

6 years agohung-chang-dso-2100: Fix a gcc 7 compiler warning.
Uwe Hermann [Sat, 24 Jun 2017 16:25:40 +0000 (18:25 +0200)]
hung-chang-dso-2100: Fix a gcc 7 compiler warning.

  ../src/hardware/hung-chang-dso-2100/api.c: In function ‘config_commit’:
  ../src/hardware/hung-chang-dso-2100/api.c:562:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
     state = 0x01;
     ~~~~~~^~~~~~
  ../src/hardware/hung-chang-dso-2100/api.c:563:2: note: here
    default:
    ^~~~~~~
  ../src/hardware/hung-chang-dso-2100/api.c:565:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (ret != SR_OK)
        ^
  ../src/hardware/hung-chang-dso-2100/api.c:567:2: note: here
    case 0x01:
    ^~~~

6 years agooutput/csv: Fix a gcc 7 compiler warning.
Uwe Hermann [Sat, 24 Jun 2017 16:04:27 +0000 (18:04 +0200)]
output/csv: Fix a gcc 7 compiler warning.

  ../src/output/csv.c: In function ‘receive’:
  ../src/output/csv.c:580:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
     *out = g_string_new(ctx->frame);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/output/csv.c:582:2: note: here
    case SR_DF_END:
    ^~~~

6 years agoinput/wav: Fix incorrect memset() call.
Uwe Hermann [Sat, 24 Jun 2017 15:26:02 +0000 (17:26 +0200)]
input/wav: Fix incorrect memset() call.

  ../src/input/wav.c: In function ‘send_chunk’:
  ../src/input/wav.c:200:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
    memset(fdata, 0, CHUNK_SIZE);
    ^~~~~~

6 years agoinput/raw_analog: Fix gcc 7 compiler warnings.
Uwe Hermann [Sat, 24 Jun 2017 15:23:56 +0000 (17:23 +0200)]
input/raw_analog: Fix gcc 7 compiler warnings.

  ../src/input/raw_analog.c: In function ‘init’:
  ../src/input/raw_analog.c:133:31: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
     snprintf(channelname, 8, "CH%d", i + 1);
                                 ^~
  ../src/input/raw_analog.c:133:28: note: directive argument in the range [1, 2147483647]
     snprintf(channelname, 8, "CH%d", i + 1);
                              ^~~~~~
  ../src/input/raw_analog.c:133:3: note: ‘snprintf’ output between 4 and 13 bytes into a destination of size 8
     snprintf(channelname, 8, "CH%d", i + 1);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agodemo: Mask out logic data for disabled channels in datafeed packets
Gerhard Sittig [Tue, 20 Jun 2017 19:04:37 +0000 (21:04 +0200)]
demo: Mask out logic data for disabled channels in datafeed packets

The previous implementation used to provide datafeed packets which
contain logic data in positions that correspond to disabled channels.

Do mask out logic data of disabled channels in the memory image before
it is sent to the session's datafeed. This implementation works fine for
those situations where either all logic channels are enabled (default
configuration) or when only the upper channels get disabled (which can
be considered a typical use case).

For those configurations where enabled channels follow disabled channels
(i.e. setups with gaps in the sequence of enabled channels) behaviour
will be unexpected: Neither is the mask adjusted to contain gaps, nor
will enabled channels get mapped to result in a dense representation.
The respective code paths are marked with TODO comments.

Add a comment to discuss a non-obvious generator call for analog data in
the acquisition start routine, while we are here.

6 years agodemo: Skip generating data when all channels in a group are disabled
Gerhard Sittig [Sat, 17 Jun 2017 18:59:18 +0000 (20:59 +0200)]
demo: Skip generating data when all channels in a group are disabled

The generator logic determines how many samples per group (analog and
logic) need to get produced, then keeps iterating until each group has
reached the specified count. Different groups can generate different
numbers of samples per iteration, they have their own stride.

It's essential to check whether all channels in a group are disabled, to
then completely skip the respective half of the generation loop. Without
this check, the group would be expected to generate data but it won't,
which results in an endless loop. This was observed with analog channels.

There was another issue with logic channels. Unexpected logic data was
seen in the output although neither logic channel was selected.

This commit fixes bug #923.

6 years agodemo: Don't generate analog output data for disabled channels
Gerhard Sittig [Sat, 17 Jun 2017 18:33:12 +0000 (20:33 +0200)]
demo: Don't generate analog output data for disabled channels

Skip the emission of session datafeed packets for disabled analog
channels.

Implementation detail: Allow for quick lookup of the channel that is
associated with an analog generator, as the data generation routines
only pass generator references in later calls.

This fixes part of bug #923 (which initially is about unexpected
logic data while analog channels were affected in similar ways).

6 years agodemo: Only send average result data when averaging is active
Gerhard Sittig [Sat, 17 Jun 2017 17:23:35 +0000 (19:23 +0200)]
demo: Only send average result data when averaging is active

After the requested number of samples was sent, another session df
packet was emitted with one sample for the analog channels, which
contained the most recent result of averaging. Make this emission
depend on the "averaging requested?" flag.

This fixes bug #930.

6 years agodemo: Unbreak execution with all analog channels disabled
Gerhard Sittig [Sat, 17 Jun 2017 15:58:45 +0000 (17:58 +0200)]
demo: Unbreak execution with all analog channels disabled

The 'demo' driver supports scan options to adjust the number of
supported channels, and runtime control for the enabled state of
channels.

Starting with zero analog channels created (scan option) resulted in a
runtime assertion. Creating but disabling analog channels (GUI checkbox,
CLI option) resulted in unexpected output for disabled channels.

Move the creation of a hash table out of the conditional loop that
iterates over created analog channels. Which results in the table's
always being valid, and iteration during data acquisition yields no
analog output as is expected.

This fixes bug #625.

6 years agodemo: Drop previous "default enabled" logic (experiment remainder)
Gerhard Sittig [Sun, 11 Jun 2017 19:02:57 +0000 (21:02 +0200)]
demo: Drop previous "default enabled" logic (experiment remainder)

A previous implementation of the demo driver supported the creation of
larger channel counts yet only enabling part of them by default. This
was kind of pointless, I just was not aware of the available scan
options.

Drop the "enabled channels" limitation, enable all channels that get
created (like the implementation before the experiment did), and create
as many channels as was compiled in by default or later got specified
by scan options.

6 years agodreamsourcelab-dslogic: Drop an assert().
Uwe Hermann [Wed, 21 Jun 2017 06:00:51 +0000 (08:00 +0200)]
dreamsourcelab-dslogic: Drop an assert().

6 years agodreamsourcelab-dslogic: Don't check for USB manufacturer/product.
Uwe Hermann [Wed, 21 Jun 2017 05:53:20 +0000 (07:53 +0200)]
dreamsourcelab-dslogic: Don't check for USB manufacturer/product.

Before firmware upload some models (e.g. the original DSLogic or the
DSLogic Pro) don't have any USB manufacturer or product strings set, so
they wouldn't be detected.

6 years agodreamsourcelab-dslogic: Drop an unneeded dslogic_ prefix.
Uwe Hermann [Tue, 20 Jun 2017 21:29:25 +0000 (23:29 +0200)]
dreamsourcelab-dslogic: Drop an unneeded dslogic_ prefix.

6 years agodreamsourcelab-dslogic: Naming and other consistency fixes.
Uwe Hermann [Tue, 20 Jun 2017 21:07:27 +0000 (23:07 +0200)]
dreamsourcelab-dslogic: Naming and other consistency fixes.

6 years agodslogic: Recast samples into sigrok-compatible sample words
Joel Holdsworth [Thu, 15 Jun 2017 22:52:10 +0000 (16:52 -0600)]
dslogic: Recast samples into sigrok-compatible sample words

6 years agodslogic: Fixed buffer size calculation
Joel Holdsworth [Thu, 15 Jun 2017 22:21:44 +0000 (16:21 -0600)]
dslogic: Fixed buffer size calculation

6 years agodslogic: Factored out enabled_channel_count, enabled_channel_mask
Joel Holdsworth [Thu, 15 Jun 2017 21:35:11 +0000 (15:35 -0600)]
dslogic: Factored out enabled_channel_count, enabled_channel_mask

6 years agodslogic: Don't leak the trigger transfers array
Joel Holdsworth [Thu, 15 Jun 2017 21:13:57 +0000 (15:13 -0600)]
dslogic: Don't leak the trigger transfers array

6 years agodslogic: Removed trigger_fired option
Joel Holdsworth [Thu, 15 Jun 2017 20:52:28 +0000 (14:52 -0600)]
dslogic: Removed trigger_fired option

6 years agodslogic: Merged trigger_request into dslogic_acquisition_start
Joel Holdsworth [Thu, 15 Jun 2017 20:54:23 +0000 (14:54 -0600)]
dslogic: Merged trigger_request into dslogic_acquisition_start

6 years agodslogic: Moved all protocol handling to protocol.c
Joel Holdsworth [Thu, 15 Jun 2017 19:32:01 +0000 (13:32 -0600)]
dslogic: Moved all protocol handling to protocol.c

Previously the USB communication code was split between api.ci,
dslogic.c and protocol.c, with protocol internals split between
both. This patch puts all the protocol handling code into one
source file reducing the number of internal interfaces and making
the code more readable.

6 years agofx2lafw: Moved all protocol handling to protocol.c
Joel Holdsworth [Thu, 15 Jun 2017 17:34:52 +0000 (11:34 -0600)]
fx2lafw: Moved all protocol handling to protocol.c

Previously the USB communication code was split between api.c
and protocol.c, with protocol internals split between both. This
patch puts all the protocol handling code into one source file
reducing the number of internal interfaces and making the code
more readable.

6 years agodslogic: Fixed FPGA setting code
Joel Holdsworth [Wed, 14 Jun 2017 21:21:54 +0000 (15:21 -0600)]
dslogic: Fixed FPGA setting code

6 years agodslogic: Declare memory depths
Joel Holdsworth [Wed, 14 Jun 2017 20:20:12 +0000 (14:20 -0600)]
dslogic: Declare memory depths

6 years agodslogic: Fixed voltage selection
Joel Holdsworth [Tue, 13 Jun 2017 22:27:03 +0000 (16:27 -0600)]
dslogic: Fixed voltage selection

6 years agodslogic: Updated matching of device with loaded firmware
Joel Holdsworth [Tue, 13 Jun 2017 18:07:00 +0000 (12:07 -0600)]
dslogic: Updated matching of device with loaded firmware

6 years agodslogic: Renamed D0-16 channels to 0-16
Joel Holdsworth [Mon, 12 Jun 2017 23:08:55 +0000 (17:08 -0600)]
dslogic: Renamed D0-16 channels to 0-16

6 years agodslogic: Added half and quater-mode flags
Joel Holdsworth [Mon, 12 Jun 2017 22:46:31 +0000 (16:46 -0600)]
dslogic: Added half and quater-mode flags

6 years agodslogic: Simplified supported_device table
Joel Holdsworth [Mon, 12 Jun 2017 17:37:31 +0000 (11:37 -0600)]
dslogic: Simplified supported_device table

6 years agodslogic: Refactored firmware selection into dslogic_fpga_firmware_upload
Joel Holdsworth [Mon, 12 Jun 2017 19:19:44 +0000 (13:19 -0600)]
dslogic: Refactored firmware selection into dslogic_fpga_firmware_upload

6 years agofx2lafw/dslogic: Split DSLogic into a separate driver
Joel Holdsworth [Sat, 10 Jun 2017 00:02:29 +0000 (18:02 -0600)]
fx2lafw/dslogic: Split DSLogic into a separate driver

6 years agousb.c: Moved in usb_match_manuf_product
Joel Holdsworth [Mon, 12 Jun 2017 17:30:52 +0000 (11:30 -0600)]
usb.c: Moved in usb_match_manuf_product

6 years agofx2lafw/dslogic: Updated dslogic_fpga_config structure to reflect v0.97 firmware
Joel Holdsworth [Fri, 9 Jun 2017 23:33:46 +0000 (17:33 -0600)]
fx2lafw/dslogic: Updated dslogic_fpga_config structure to reflect v0.97 firmware

6 years agofx2lafw/dslogic: Imported FPGA config mode flags
Joel Holdsworth [Fri, 9 Jun 2017 23:29:08 +0000 (17:29 -0600)]
fx2lafw/dslogic: Imported FPGA config mode flags

6 years agofx2lafw/dslogic: Use const buffer instead of memset
Joel Holdsworth [Thu, 8 Jun 2017 22:49:18 +0000 (16:49 -0600)]
fx2lafw/dslogic: Use const buffer instead of memset

6 years agofx2lafw/dslogic: Fixed dslogic_set_vth package structure
Joel Holdsworth [Thu, 8 Jun 2017 22:47:57 +0000 (16:47 -0600)]
fx2lafw/dslogic: Fixed dslogic_set_vth package structure

6 years agofx2lafw/dslogic: Added register address #defines
Joel Holdsworth [Thu, 8 Jun 2017 22:47:01 +0000 (16:47 -0600)]
fx2lafw/dslogic: Added register address #defines

6 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

6 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

6 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

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

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

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

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

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

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

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

6 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]

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

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

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

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

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

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

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