]> sigrok.org Git - libsigrok.git/log
libsigrok.git
8 years agoBuild: Set local include directories in Makefile.am
Daniel Elstner [Wed, 12 Aug 2015 23:18:51 +0000 (01:18 +0200)]
Build: Set local include directories in Makefile.am

Move the include flags for files in the source tree from
configure.ac to Makefile.am where they belong.  Also use
AM_CPPFLAGS instead of CFLAGS/CXXFLAGS to make sure the
files in the build/source tree are always picked up first.

Also, remove the include/libsigrok sub-directory from the
search path, thereby making the <libsigrok/> prefix mandatory
when building libsigrok itself.  This matches the convention
already imposed on users of the library.

8 years agoIntroduce OutputFlag
Soeren Apel [Sat, 15 Aug 2015 21:40:29 +0000 (23:40 +0200)]
Introduce OutputFlag

8 years agooutput/srzip: Prevent memory leak in case filename is empty
Soeren Apel [Sat, 1 Aug 2015 19:41:32 +0000 (21:41 +0200)]
output/srzip: Prevent memory leak in case filename is empty

8 years agobackend: Output lib versions, host, and endianness in sr_init().
Uwe Hermann [Sat, 15 Aug 2015 19:06:30 +0000 (21:06 +0200)]
backend: Output lib versions, host, and endianness in sr_init().

This should help to more easily debug issues reported by users.

8 years agobrymen-bm86x: add some error checking
Aurelien Jacobs [Thu, 13 Aug 2015 23:03:57 +0000 (01:03 +0200)]
brymen-bm86x: add some error checking

8 years agoVarious minor cosmetics and consistency fixes.
Uwe Hermann [Sat, 15 Aug 2015 15:16:01 +0000 (17:16 +0200)]
Various minor cosmetics and consistency fixes.

8 years agoDrop comment mentioning non-existing function.
Uwe Hermann [Sat, 15 Aug 2015 15:09:29 +0000 (17:09 +0200)]
Drop comment mentioning non-existing function.

8 years agoDoxygen consistency fixes (@foo instead of \foo).
Uwe Hermann [Wed, 5 Aug 2015 15:23:54 +0000 (17:23 +0200)]
Doxygen consistency fixes (@foo instead of \foo).

8 years agoVarious errno/strerror() related fixes.
Uwe Hermann [Wed, 29 Jul 2015 17:31:43 +0000 (19:31 +0200)]
Various errno/strerror() related fixes.

 - Don't #include <errno.h> in files that don't actually need it.

 - Don't use strerror() on error codes from functions that don't set
   errno. Replace strerror() with sr_strerror() for libsigrok functions.

8 years agolibsigrok: demo: close pipes on dev_acquisition_stop()
Hubert CHAUMETTE [Fri, 31 Jul 2015 07:44:09 +0000 (09:44 +0200)]
libsigrok: demo: close pipes on dev_acquisition_stop()

Fixes a bug where new acquisition failes due to leftover pipes from
previous acquisitions:
sr: demo: dev_acquisition_start: pipe() failed
Indeed, PulseView had 2024 pipes opened. With this fix, it stabilizes at
33 with sampling thread active.

Signed-off-by: Hubert CHAUMETTE <redacted>
8 years agooutput/srzip: Use sr_output->filename instead of option
Soeren Apel [Thu, 30 Jul 2015 05:29:11 +0000 (07:29 +0200)]
output/srzip: Use sr_output->filename instead of option

This fixes parts of bug #570.

8 years agoAdd filename field to sr_output and make it accessible
Soeren Apel [Wed, 29 Jul 2015 19:19:49 +0000 (21:19 +0200)]
Add filename field to sr_output and make it accessible

This fixes parts of bug #570.

8 years agoOnly build BayLibre ACME driver if <sys/timerfd.h> is available.
Uwe Hermann [Sat, 25 Jul 2015 17:50:36 +0000 (19:50 +0200)]
Only build BayLibre ACME driver if <sys/timerfd.h> is available.

This fixes bug #610 (Android build issue).

8 years agools: Don't #include <libserialport.h> directly.
Uwe Hermann [Sat, 25 Jul 2015 14:59:04 +0000 (16:59 +0200)]
ols: Don't #include <libserialport.h> directly.

The driver is not using sp_* calls directly, so no need to #include
the header file.

8 years agoBump version to 0.4.0 (the upcoming next major release).
Uwe Hermann [Sat, 18 Jul 2015 16:03:29 +0000 (18:03 +0200)]
Bump version to 0.4.0 (the upcoming next major release).

8 years agoAppend "-git" to the version string.
Uwe Hermann [Sat, 18 Jul 2015 15:54:41 +0000 (17:54 +0200)]
Append "-git" to the version string.

This avoids confusion with the released tarballs.

8 years agoConvert a few more occurrences of d->priv to d->context.
Uwe Hermann [Thu, 9 Jul 2015 19:05:44 +0000 (21:05 +0200)]
Convert a few more occurrences of d->priv to d->context.

8 years agoFix #442 by renaming sr_dev_driver.priv to .context
Soeren Apel [Mon, 6 Jul 2015 19:55:36 +0000 (21:55 +0200)]
Fix #442 by renaming sr_dev_driver.priv to .context

8 years agofx2lafw: Use the USB_INTERFACE #define.
Uwe Hermann [Thu, 9 Jul 2015 23:03:16 +0000 (01:03 +0200)]
fx2lafw: Use the USB_INTERFACE #define.

8 years agofx2lafw: Fix segfault wrt libusb_detach_kernel_driver().
Uwe Hermann [Thu, 9 Jul 2015 22:59:48 +0000 (00:59 +0200)]
fx2lafw: Fix segfault wrt libusb_detach_kernel_driver().

Move the libusb_detach_kernel_driver() call after the code that
sets the usb->devhdl pointer, otherwise it'll be NULL and result
in a segfault.

  #0  libusb_kernel_driver_active (dev=0x0, interface_number=0) at libusb/core.c:1711
  #1  dev_open (sdi=0x12d99f0) at src/hardware/fx2lafw/api.c:374
  [...]

Tested on a device with the default Cypress VID/PID and one with
the Saleae Logic VID/PID, both works fine.

8 years agofx2lafw: Fix #445 by detaching the kernel driver (if any)
Soeren Apel [Mon, 6 Jul 2015 19:20:26 +0000 (21:20 +0200)]
fx2lafw: Fix #445 by detaching the kernel driver (if any)

This avoids the need to run "rmmod usbtest" on Linux for devices
with the standard Cypress FX2 USB VID/PID (04b4:8613).

8 years agoDemo: Fix #314 by always honoring sample limit changes
Daniel King [Mon, 6 Jul 2015 19:16:29 +0000 (21:16 +0200)]
Demo: Fix #314 by always honoring sample limit changes

8 years agoFix #505 by providing a separate property list for the analog group
Soeren Apel [Sun, 5 Jul 2015 19:06:05 +0000 (21:06 +0200)]
Fix #505 by providing a separate property list for the analog group

8 years agoFix #574 by setting up the transfer first, then starting acquisition
Soeren Apel [Sun, 5 Jul 2015 16:01:45 +0000 (18:01 +0200)]
Fix #574 by setting up the transfer first, then starting acquisition

8 years agobaylibre-acme: Remove unnecessary close().
Bartosz Golaszewski [Wed, 1 Jul 2015 10:30:09 +0000 (12:30 +0200)]
baylibre-acme: Remove unnecessary close().

The timerfd descriptor is closed automatically by
g_io_channel_shutdown(). No need to close it manually.

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd.
Bartosz Golaszewski [Wed, 1 Jul 2015 08:47:38 +0000 (10:47 +0200)]
baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd.

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Add a workaround for slow data acquisition.
Bartosz Golaszewski [Tue, 30 Jun 2015 13:07:50 +0000 (15:07 +0200)]
baylibre-acme: Add a workaround for slow data acquisition.

At high sampling rates and maximum channels we are not able to acquire
samples fast enough, even though frontends still think that samples
arrive on time. This causes visible shifts in frontend plots.

To compensate for the delay introduce the following workaround: check
if we are late (if any clock events have been missed) and resend the
last frame n times (n == number of missed clock events).

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Use timerfd instead of a fake pipe.
Daniel Lezcano [Thu, 4 Jun 2015 17:01:27 +0000 (19:01 +0200)]
baylibre-acme: Use timerfd instead of a fake pipe.

Currently baylibre-acme uses a fake pipe as the input channel required by
libsigrok API and calls sleep() in the data acquisition callback to create
intervals between measurements.

Switch to a more elegant approach: use Linux' timerfd and set a periodic
timer equal to the sampling rate. Then read the data every time the timer
expires.

Signed-off-by: Daniel Lezcano <redacted>
Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Close sysfs files after stopping the acquisition.
Bartosz Golaszewski [Thu, 28 May 2015 13:45:56 +0000 (15:45 +0200)]
baylibre-acme: Close sysfs files after stopping the acquisition.

Add a missing call to dev_acquisition_close() in dev_acquisition_stop().

Signed-off-by: Bartosz Golaszewski <redacted>
8 years agobaylibre-acme: Optimize reading of values from sysfs.
Daniel Lezcano [Wed, 27 May 2015 18:22:02 +0000 (20:22 +0200)]
baylibre-acme: Optimize reading of values from sysfs.

Opening a file has a cost (security, allocation, syscalls). The
read_sample() function always does an open/read/close sequence.

In order to optimize that, let's open the file at the moment the
acquisition starts, close it when the acquisition stops and make
read_sample() only lseek() to the beginning of the file and read
the value.

Signed-off-by: Daniel Lezcano <redacted>
Signed-off-by: Bartosz Golaszewski <redacted>
8 years agosysclk-lwla: Do not create channels in reverse order
Daniel Elstner [Wed, 24 Jun 2015 17:16:49 +0000 (19:16 +0200)]
sysclk-lwla: Do not create channels in reverse order

This was originally done as an optimization in combination with a list
reversal which has since been removed from the code.  Thus, un-reverse
the channels so that the UI lists them in the correct order again.

8 years agoyokogawa-dlm: Minor cosmetics, consistency fixes, typos.
Uwe Hermann [Mon, 22 Jun 2015 22:39:59 +0000 (00:39 +0200)]
yokogawa-dlm: Minor cosmetics, consistency fixes, typos.

8 years agoyokogawa-dlm: Return correct value for SR_CONF_HDIV
Soeren Apel [Sun, 7 Jun 2015 09:52:30 +0000 (11:52 +0200)]
yokogawa-dlm: Return correct value for SR_CONF_HDIV

8 years agoyokogawa-dlm: Remove dlm_setup_channels()
Soeren Apel [Sun, 7 Jun 2015 09:51:40 +0000 (11:51 +0200)]
yokogawa-dlm: Remove dlm_setup_channels()

8 years agoyokogawa-dlm: Introduce config_channel_set()
Soeren Apel [Sun, 7 Jun 2015 09:50:29 +0000 (11:50 +0200)]
yokogawa-dlm: Introduce config_channel_set()

8 years agoyokogawa-dlm: Config get/set/list handler updates
Soeren Apel [Sun, 7 Jun 2015 09:40:39 +0000 (11:40 +0200)]
yokogawa-dlm: Config get/set/list handler updates

8 years agoyokogawa-dlm: Fix number of digital groups
Soeren Apel [Sun, 7 Jun 2015 09:37:27 +0000 (11:37 +0200)]
yokogawa-dlm: Fix number of digital groups

8 years agoyokogawa-dlm: Prevent duplicate channel index
Soeren Apel [Sun, 7 Jun 2015 09:36:38 +0000 (11:36 +0200)]
yokogawa-dlm: Prevent duplicate channel index

8 years agoyokogawa-dlm: Add support for the DL9000 series
Soeren Apel [Sun, 7 Jun 2015 09:35:21 +0000 (11:35 +0200)]
yokogawa-dlm: Add support for the DL9000 series

8 years agofx2lafw: Add DSLogic Pro and DSCope firmware loading support
Daniel Gröber [Sat, 2 May 2015 22:31:49 +0000 (00:31 +0200)]
fx2lafw: Add DSLogic Pro and DSCope firmware loading support

8 years agodslogic: Fix incorrect samplerate setting.
Carl-Fredrik Sundström [Mon, 22 Jun 2015 14:53:51 +0000 (16:53 +0200)]
dslogic: Fix incorrect samplerate setting.

8 years agobindings/python: Handle import failures without crashing
Alexandru Gagniuc [Wed, 6 May 2015 07:32:30 +0000 (00:32 -0700)]
bindings/python: Handle import failures without crashing

When the import of gi.repository.GLib failed, we would get a NULL
pointer that we passed along without any checking. In this situation,
the entire program would crash with a segmentation fault, and no
message to indicate the problem.

When the import fails, abort the SWIG init and print a message. The
Python interpreter then prints out a backtrace, which can be useful
in tracking down the problem.

8 years agoscpi-pps: Chroma 62000P: Get capabilities from device name
Alexandru Gagniuc [Sun, 17 May 2015 00:30:47 +0000 (17:30 -0700)]
scpi-pps: Chroma 62000P: Get capabilities from device name

The Chroma 62000P series comes in various models with different
current and voltage capabilities. These are encoded in the *IDN
string, so just get them from there, rather than needing a profile
for every model.

8 years agoscpi-pps: Add profile for Chroma 62024P-80-60 DC Source
Alexandru Gagniuc [Sat, 9 May 2015 03:54:08 +0000 (20:54 -0700)]
scpi-pps: Add profile for Chroma 62024P-80-60 DC Source

8 years agoJava: install files into DESTDIR
Jiří Pinkava [Fri, 29 May 2015 22:00:19 +0000 (00:00 +0200)]
Java: install files into DESTDIR

This fixes bug #537.

8 years agosaleae-logic16: Emit debug info of which bitstream is used.
Uwe Hermann [Thu, 11 Jun 2015 16:27:43 +0000 (18:27 +0200)]
saleae-logic16: Emit debug info of which bitstream is used.

8 years agosaleae-logic16: Support new bitstream version 1.3 with renumbered registers
Marcus Comstedt [Sat, 9 May 2015 11:16:28 +0000 (13:16 +0200)]
saleae-logic16: Support new bitstream version 1.3 with renumbered registers

8 years agoscpi: Update names of a few *_OUTPUT_* items.
Uwe Hermann [Sun, 7 Jun 2015 18:58:46 +0000 (20:58 +0200)]
scpi: Update names of a few *_OUTPUT_* items.

8 years agomodbus: Consistently use the "Modbus" spelling.
Uwe Hermann [Sun, 7 Jun 2015 18:42:33 +0000 (20:42 +0200)]
modbus: Consistently use the "Modbus" spelling.

(as per modbus.org spelling)

8 years agomodbus: Minor typos, cosmetics and consistency fixes.
Uwe Hermann [Sun, 7 Jun 2015 18:40:32 +0000 (20:40 +0200)]
modbus: Minor typos, cosmetics and consistency fixes.

8 years agoActual implementation for the maynuo-m97 driver.
Aurelien Jacobs [Sun, 22 Feb 2015 23:28:06 +0000 (00:28 +0100)]
Actual implementation for the maynuo-m97 driver.

8 years agomaynuo-m97: Initial driver skeleton.
Aurelien Jacobs [Sun, 1 Feb 2015 22:49:03 +0000 (23:49 +0100)]
maynuo-m97: Initial driver skeleton.

8 years agolibsigrok.h: add new type of device: ELECTRONIC_LOAD.
Aurelien Jacobs [Sun, 22 Feb 2015 23:26:48 +0000 (00:26 +0100)]
libsigrok.h: add new type of device: ELECTRONIC_LOAD.

8 years agolibsigrok.h: Add SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE.
Aurelien Jacobs [Sun, 15 Mar 2015 22:58:17 +0000 (23:58 +0100)]
libsigrok.h: Add SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE.

8 years agomodbus: add a serial RTU backend.
Aurelien Jacobs [Sun, 22 Feb 2015 23:20:26 +0000 (00:20 +0100)]
modbus: add a serial RTU backend.

8 years agoAdd a modbus communication helper module.
Aurelien Jacobs [Sun, 22 Feb 2015 23:13:31 +0000 (00:13 +0100)]
Add a modbus communication helper module.

8 years agolibsigrok-internal.h: add helper macro to read floats from unaligend memory.
Aurelien Jacobs [Sun, 22 Feb 2015 23:26:16 +0000 (00:26 +0100)]
libsigrok-internal.h: add helper macro to read floats from unaligend memory.

8 years agoRename SR_CONF_OUTPUT_* to SR_CONF_*.
Aurelien Jacobs [Sun, 15 Mar 2015 17:43:06 +0000 (18:43 +0100)]
Rename SR_CONF_OUTPUT_* to SR_CONF_*.

All those options are currently applied only to power-supplies
but they could apply as well to electronic loads, except for the
fact that electronic loads channels are called inputs and not
outputs.
Also when you think about an SMU (or any kind of 4-quadrants
power-supply), their channels can both source and sink current,
so they can be considered as input as much as output.
Those SR_CONF_* are thus renamed so that they can be used in all
those situations.

8 years agoscpi-pps: don't fail acquisition start for devices with no CMD_SELECT_CHANNEL
Aurelien Jacobs [Sat, 9 May 2015 21:06:10 +0000 (23:06 +0200)]
scpi-pps: don't fail acquisition start for devices with no CMD_SELECT_CHANNEL

For devices such as the HP 6632B the following invocation was failing due to
scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, ...) returning SR_OK_CONTINUE.

./sigrok-cli -d scpi-pps:conn=/dev/ttyUSB0:serialcomm=9600/8n1 --continuous
sr: session: sr_session_start: could not start an acquisition (not enough data to decide error status yet)
Failed to start session.

8 years agoUse G_PI instead of defining our own version of PI.
Aurelien Jacobs [Tue, 28 Apr 2015 23:08:17 +0000 (01:08 +0200)]
Use G_PI instead of defining our own version of PI.

8 years agoscpi-pps: Minor cleanups.
Uwe Hermann [Thu, 7 May 2015 01:15:35 +0000 (03:15 +0200)]
scpi-pps: Minor cleanups.

8 years agoscpi-pps: Fix a compiler warning.
Uwe Hermann [Thu, 7 May 2015 00:52:00 +0000 (02:52 +0200)]
scpi-pps: Fix a compiler warning.

    CC       src/hardware/scpi-pps/profiles.lo
  src/hardware/scpi-pps/profiles.c:67:2: warning: missing initializer
  for field 'frequency' of 'const struct channel_spec'
  [-Wmissing-field-initializers]
    { "1", { 0, 60, 0.0001 }, { 0, 25, 0.1 } },
    ^
  In file included from src/hardware/scpi-pps/profiles.c:24:0:
  src/hardware/scpi-pps/protocol.h:106:8: note: 'frequency' declared
  here
    float frequency[3];
          ^

8 years agoscpi-pps: Make some more items static.
Uwe Hermann [Thu, 7 May 2015 00:49:59 +0000 (02:49 +0200)]
scpi-pps: Make some more items static.

8 years agospci-pps: Add profile for Agilent N5767A DC source
Alexandru Gagniuc [Thu, 23 Apr 2015 16:38:14 +0000 (09:38 -0700)]
spci-pps: Add profile for Agilent N5767A DC source

8 years agospci-pps/profiles: Support frequency control in Chroma 61604
Alexandru Gagniuc [Thu, 30 Apr 2015 00:33:03 +0000 (17:33 -0700)]
spci-pps/profiles: Support frequency control in Chroma 61604

8 years agoscpi-pps: Add infrastructure for controlling output frequency
Alexandru Gagniuc [Thu, 30 Apr 2015 00:26:47 +0000 (17:26 -0700)]
scpi-pps: Add infrastructure for controlling output frequency

This patch only adds the needed infrastructure to control output
frequency in the same manner as output voltage or current limit. This
does require a new field in the channel_spec struct, for the sake of
symmetry.

8 years agoglobal: Add configuration key for output frequency target
Alexandru Gagniuc [Thu, 30 Apr 2015 00:05:59 +0000 (17:05 -0700)]
global: Add configuration key for output frequency target

This will be used to set up the output frequency of AC sources.

8 years agoglobal: Treat SR_CONF_OUTPUT_FREQUENCY as float instead of uint64_t
Alexandru Gagniuc [Wed, 29 Apr 2015 23:58:24 +0000 (16:58 -0700)]
global: Treat SR_CONF_OUTPUT_FREQUENCY as float instead of uint64_t

This makes 'output_frequency' symmetrical with 'output_current' and
'output_voltage'. On a more fundamental level, there's no reason why
frequency should be treated as a discrete quantity, other than
"es51919 used it this way".

8 years agoasix-sigma: Avoid use of variable length arrays
Alexandru Gagniuc [Tue, 28 Apr 2015 20:03:58 +0000 (13:03 -0700)]
asix-sigma: Avoid use of variable length arrays

This was only done once in sigma_write_register().

8 years agopython: classes.i: Declare strings with std::string
Alexandru Gagniuc [Thu, 30 Apr 2015 23:18:46 +0000 (16:18 -0700)]
python: classes.i: Declare strings with std::string

This makes it consistent with the rest of the string declarations in
this file, all of which use std::string.

8 years agospci-pps: Add profile for Chroma 61604 AC Source
Alexandru Gagniuc [Thu, 23 Apr 2015 16:39:23 +0000 (09:39 -0700)]
spci-pps: Add profile for Chroma 61604 AC Source

Only the capabilities which map directly to SCPI commands supported by
sigrok are implemented at this time. This is sufficient to control
the most often used functionality of this AC source

8 years agoscpi: Accept *IDN responses with more than four tokens
Alexandru Gagniuc [Thu, 16 Apr 2015 04:30:10 +0000 (21:30 -0700)]
scpi: Accept *IDN responses with more than four tokens

Some devices with more than one microcontroller report the firmware
version for each of them, giving us more than four tokens. When that
happens, sigrok aborts, even though it received a valid response.

This happens, for example with the Chroma 61604:
'Chroma ATE,61604,001060,1.25,1.34,1.20'

9 years agoCompile with -std=c11 along with _POSIX_C_SOURCE=200112L.
Aurelien Jacobs [Sun, 26 Apr 2015 22:06:03 +0000 (00:06 +0200)]
Compile with -std=c11 along with _POSIX_C_SOURCE=200112L.

With gcc 5.1 released and defaulting to std=gnu11, the code will be compiled
according to different standards depending on the compiler version so we
should better specify explicitly what standard we are targetting.
C11 is now quite mature, it is supported in the just release Debian stable
(gcc 4.9) and also in old-stable (gcc 4.7), so there should be no reason to
use anything more ancient.
We also should have no reason to need any non-standard GNU extension.
So using only C11 + POSIX sounds like the best option right now.

9 years agoDefine our own constant for PI.
Aurelien Jacobs [Sun, 26 Apr 2015 22:42:05 +0000 (00:42 +0200)]
Define our own constant for PI.

M_PI is not defined in the C standard nor in POSIX, it is a
non-standard GNU extension.

9 years agostrcasecmp() is defined in strings.h.
Aurelien Jacobs [Sun, 26 Apr 2015 22:30:15 +0000 (00:30 +0200)]
strcasecmp() is defined in strings.h.

9 years agowav: Stricter check for valid chunk ID.
Aurelien Jacobs [Sun, 26 Apr 2015 22:13:23 +0000 (00:13 +0200)]
wav: Stricter check for valid chunk ID.

isascii() is a superset of isalpha() and isblank() so the current
code doesn't really make sense.
Moreover, isascii(x) is just a funky and non standard way to
write x < 128.

9 years agoC++: Change arguments of Input::send() from std::string to data+length.
Martin Ling [Mon, 20 Apr 2015 09:02:34 +0000 (10:02 +0100)]
C++: Change arguments of Input::send() from std::string to data+length.

9 years agoLower libserialport requirement to 0.1.1.
Uwe Hermann [Sun, 19 Apr 2015 16:39:35 +0000 (18:39 +0200)]
Lower libserialport requirement to 0.1.1.

9 years agoFix various warnings when building without libusb.
Uwe Hermann [Thu, 16 Apr 2015 20:33:29 +0000 (22:33 +0200)]
Fix various warnings when building without libusb.

  ../src/backend.c: In function 'sr_init':
  ../src/backend.c:435:1: warning: label 'done' defined but not used [-Wunused-label]
   done:
   ^

  ../src/device.c: In function 'sr_dev_inst_connid_get':
  ../src/device.c:525:7: warning: unused variable 'connection_id' [-Wunused-variable]
    char connection_id[64];
         ^
  ../src/device.c:524:20: warning: unused variable 'b' [-Wunused-variable]
    int r, cnt, i, a, b;
                      ^
  ../src/device.c:524:17: warning: unused variable 'a' [-Wunused-variable]
    int r, cnt, i, a, b;
                   ^
  ../src/device.c:524:14: warning: unused variable 'i' [-Wunused-variable]
    int r, cnt, i, a, b;
                ^
  ../src/device.c:524:9: warning: unused variable 'cnt' [-Wunused-variable]
    int r, cnt, i, a, b;
           ^
  ../src/device.c:524:6: warning: unused variable 'r' [-Wunused-variable]
    int r, cnt, i, a, b;
        ^
  ../src/device.c:523:22: warning: unused variable 'drvc' [-Wunused-variable]
    struct drv_context *drvc;
                      ^

9 years agools: Whitespace fixes.
Uwe Hermann [Wed, 15 Apr 2015 19:08:13 +0000 (21:08 +0200)]
ols: Whitespace fixes.

9 years ago.gitignore: Add tests/main.
Uwe Hermann [Fri, 17 Apr 2015 15:17:53 +0000 (17:17 +0200)]
.gitignore: Add tests/main.

9 years agobaylibre-acme: Add a missing return value check.
Bartosz Golaszewski [Mon, 13 Apr 2015 09:44:14 +0000 (11:44 +0200)]
baylibre-acme: Add a missing return value check.

Check the return value of sr_gpio_setval_export() in bl_acme_set_power_off()
and return an appropriate error if the call fails.

Signed-off-by: Bartosz Golaszewski <redacted>
9 years agoRevert "baylibre-acme: Fix a compiler warning."
Bartosz Golaszewski [Mon, 13 Apr 2015 09:44:13 +0000 (11:44 +0200)]
Revert "baylibre-acme: Fix a compiler warning."

This reverts commit 4cd97e5ad7bb63cb90d209506464fafd9f9eef8a.

We should actually check the return value of sr_gpio_setval_export().

Signed-off-by: Bartosz Golaszewski <redacted>
9 years agowindows: Fix various compiler warnings.
Uwe Hermann [Sun, 12 Apr 2015 17:28:03 +0000 (19:28 +0200)]
windows: Fix various compiler warnings.

Add LIBUSB_CALL where needed to avoid warnings such as the following:

  In file included from src/hardware/hantek-dso/api.c:34:0:
  src/hardware/hantek-dso/dso.h:212:13:
  note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
   SR_PRIV int dso_get_channeldata(const struct sr_dev_inst *sdi,
               ^

9 years agoinput/wav: windows: Fix a compiler warning.
Uwe Hermann [Sun, 12 Apr 2015 16:54:43 +0000 (18:54 +0200)]
input/wav: windows: Fix a compiler warning.

  src/input/wav.c:41:0: warning: "WAVE_FORMAT_PCM" redefined
   #define WAVE_FORMAT_PCM          0x0001
   ^
  In file included from [...]/include/windows.h:86:0,
                   from [...]/include/libusb-1.0/libusb.h:70,
                   from ./src/libsigrok-internal.h:31,
                   from src/input/wav.c:28:
  [...]/include/mmsystem.h:482:0: note: this is the location of the previous definition
   #define WAVE_FORMAT_PCM 1
   ^

9 years agobaylibre-acme: Fix a compiler warning.
Uwe Hermann [Sun, 12 Apr 2015 15:26:48 +0000 (17:26 +0200)]
baylibre-acme: Fix a compiler warning.

    CC       src/hardware/baylibre-acme/protocol.lo
  ../src/hardware/baylibre-acme/protocol.c: In function 'bl_acme_set_power_off':
  ../src/hardware/baylibre-acme/protocol.c:417:6: warning: variable 'val' set but not used [-Wunused-but-set-variable]
    int val;
        ^

9 years agobaylibre-acme: Set update_interval when modifing samplerate.
Bartosz Golaszewski [Tue, 7 Apr 2015 14:55:24 +0000 (16:55 +0200)]
baylibre-acme: Set update_interval when modifing samplerate.

Both ina2xx and tmp401 linux drivers used by baylibre-acme expose
the standard hwmon update_interval attribute, which affects the internal
update interval of the chip.

When setting samplerate for data acquisition try to modify this
attribute accordingly.

Signed-off-by: Bartosz Golaszewski <redacted>
9 years agobaylibre-acme: Dynamically check per probe config options.
Bartosz Golaszewski [Fri, 3 Apr 2015 12:58:11 +0000 (14:58 +0200)]
baylibre-acme: Dynamically check per probe config options.

PROBE_FACTOR and POWER_OFF options are advertised for all ACME probes
(channel groups) regardless of whether they actually have given capability.

Check these options in config_list() at runtime and only advertise them
for probes which support them.

Signed-off-by: Bartosz Golaszewski <redacted>
9 years agoFix a USB timeout related issue in sr_session_iteration().
Uwe Hermann [Sun, 12 Apr 2015 14:34:26 +0000 (16:34 +0200)]
Fix a USB timeout related issue in sr_session_iteration().

This issue could lead to e.g. crashes when an OLS was used.

This fixes bug #571.

9 years agouni-t-dmm: Add a missing NULL (fixes a crash on Android).
Uwe Hermann [Thu, 9 Apr 2015 21:13:30 +0000 (23:13 +0200)]
uni-t-dmm: Add a missing NULL (fixes a crash on Android).

This caused an non-terminated driver list, which lead to a crash
on Android (at least on ARM).

9 years agodslogic: Fix FPGA bitstream upload.
Uwe Hermann [Thu, 9 Apr 2015 18:02:17 +0000 (20:02 +0200)]
dslogic: Fix FPGA bitstream upload.

9 years agodslogic: Add #defines for timeouts and delays.
Uwe Hermann [Thu, 9 Apr 2015 17:55:08 +0000 (19:55 +0200)]
dslogic: Add #defines for timeouts and delays.

9 years agorigol-ds: Drop unneeded check of g_strdup_printf() result.
Uwe Hermann [Wed, 8 Apr 2015 17:14:05 +0000 (19:14 +0200)]
rigol-ds: Drop unneeded check of g_strdup_printf() result.

9 years agoconfigure.ac: Drop unneeded AC_CANONICAL_SYSTEM.
Uwe Hermann [Wed, 8 Apr 2015 16:50:07 +0000 (18:50 +0200)]
configure.ac: Drop unneeded AC_CANONICAL_SYSTEM.

9 years agoautogen.sh: Drop obsolete MinGW/MSYS items.
Uwe Hermann [Tue, 7 Apr 2015 00:35:08 +0000 (02:35 +0200)]
autogen.sh: Drop obsolete MinGW/MSYS items.

For Windows builds (which require MinGW-w64) we currently support:

 - cross-builds using MXE (mxe.cc) and possibly other cross-compile setups

 - native builds using MSYS2 (sf.net/projects/msys2/)

Neither of those require explicitly specifying ACLOCAL_DIR.

9 years agocxx: Makefile.am: Use libtool's -no-undefined option.
Uwe Hermann [Tue, 7 Apr 2015 00:29:09 +0000 (02:29 +0200)]
cxx: Makefile.am: Use libtool's -no-undefined option.

9 years agowindows: Fix building shared library on MinGW.
Martin Ling [Wed, 18 Mar 2015 12:30:26 +0000 (12:30 +0000)]
windows: Fix building shared library on MinGW.

9 years agosr_driver_list() now takes a context pointer.
Uwe Hermann [Sat, 4 Apr 2015 18:57:22 +0000 (20:57 +0200)]
sr_driver_list() now takes a context pointer.

This requires sr_hw_cleanup_all() and sanity_check_all_drivers()
to also take a context.

The (runtime) generation of the driver list now happens in sr_init()
and sr_driver_list() always returns that pre-generated list. This fixes
a segfault when (correctly) invoking multiple sr_init() and sr_exit()
calls with different contexts (caught by the unit tests).

This fixes bug #565.

9 years agolink-mso: Eliminate unneeded NUM_CHANNELS.
Uwe Hermann [Sat, 4 Apr 2015 17:28:19 +0000 (19:28 +0200)]
link-mso: Eliminate unneeded NUM_CHANNELS.

9 years agofx2lafw: Use libusb_error_name() for reporting transfer status.
Uwe Hermann [Fri, 3 Apr 2015 19:05:02 +0000 (21:05 +0200)]
fx2lafw: Use libusb_error_name() for reporting transfer status.