Commit Graph

3269 Commits

Author SHA1 Message Date
Daniel Elstner b9eb8e1a8c Consistently use SR_PACKAGE_VERSION instead of VERSION 2015-08-16 18:28:13 +02:00
Daniel Elstner 27a2497dc2 Build: Delay expansion of $datadir in FIRMWARE_DIR
Make it so that $(datadir) is resolved at make time, as per
autotools recommendations.  Note that $datadir is not fully
resolved at configure time to begin with, i.e. part of it
already was evaluated at make time.
2015-08-16 18:28:13 +02:00
Daniel Elstner b2478a23db Build: Make version.h a configuration header
Use the proper tool for the job and make libsigrok/version.h
a secondary configuration header, so that autoconf's AC_DEFINE
machinery can be used to generate it.  Note that the header
template is still hand-written, enabling fine control of the
content.
2015-08-16 18:28:13 +02:00
Daniel Elstner 4960aeb035 tests: Include <libsigrok/libsigrok.h>
This matches the global style and avoids the "../" path
components.
2015-08-16 18:28:13 +02:00
Daniel Elstner c1aae90038 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.
2015-08-16 18:28:12 +02:00
Soeren Apel 3cd4b38174 Introduce OutputFlag 2015-08-15 23:53:12 +02:00
Soeren Apel 7df31ae897 output/srzip: Prevent memory leak in case filename is empty 2015-08-15 23:53:12 +02:00
Uwe Hermann bd7b83cf63 backend: Output lib versions, host, and endianness in sr_init().
This should help to more easily debug issues reported by users.
2015-08-15 21:06:30 +02:00
Aurelien Jacobs 6d930b4159 brymen-bm86x: add some error checking 2015-08-15 17:23:28 +02:00
Uwe Hermann c442ffda0f Various minor cosmetics and consistency fixes. 2015-08-15 17:19:57 +02:00
Uwe Hermann ad0293f19c Drop comment mentioning non-existing function. 2015-08-15 17:19:42 +02:00
Uwe Hermann dff0a89435 Doxygen consistency fixes (@foo instead of \foo). 2015-08-15 17:19:42 +02:00
Uwe Hermann 8d5228015d 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.
2015-08-15 17:19:42 +02:00
Hubert CHAUMETTE 6c7d80afca 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 <hchaumette@baylibre.com>
2015-08-01 00:02:56 +02:00
Soeren Apel 37875f7506 output/srzip: Use sr_output->filename instead of option
This fixes parts of bug #570.
2015-07-30 19:22:07 +02:00
Soeren Apel 81b3ce374c Add filename field to sr_output and make it accessible
This fixes parts of bug #570.
2015-07-30 19:21:42 +02:00
Uwe Hermann 176c7219bb Only build BayLibre ACME driver if <sys/timerfd.h> is available.
This fixes bug #610 (Android build issue).
2015-07-25 19:50:36 +02:00
Uwe Hermann a394bd2813 ols: Don't #include <libserialport.h> directly.
The driver is not using sp_* calls directly, so no need to #include
the header file.
2015-07-25 16:59:04 +02:00
Uwe Hermann e6b8f35fa7 Bump version to 0.4.0 (the upcoming next major release). 2015-07-18 18:03:29 +02:00
Uwe Hermann 025f6ed862 Append "-git" to the version string.
This avoids confusion with the released tarballs.
2015-07-18 17:54:41 +02:00
Uwe Hermann 338143ea03 Convert a few more occurrences of d->priv to d->context. 2015-07-10 18:19:24 +02:00
Soeren Apel 41812aca43 Fix #442 by renaming sr_dev_driver.priv to .context 2015-07-10 01:22:15 +02:00
Uwe Hermann c11a1e6122 fx2lafw: Use the USB_INTERFACE #define. 2015-07-10 01:22:15 +02:00
Uwe Hermann dc2903bbdb 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.
2015-07-10 01:05:54 +02:00
Soeren Apel 39e4517759 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).
2015-07-10 01:03:54 +02:00
Daniel King 536141ff49 Demo: Fix #314 by always honoring sample limit changes 2015-07-09 20:22:51 +02:00
Soeren Apel e2b99f04d8 Fix #505 by providing a separate property list for the analog group 2015-07-09 20:22:51 +02:00
Soeren Apel 815e3cb83e Fix #574 by setting up the transfer first, then starting acquisition 2015-07-06 12:16:10 +02:00
Bartosz Golaszewski d586a7f4bd 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 <bgolaszewski@baylibre.com>
2015-07-01 12:30:09 +02:00
Bartosz Golaszewski 7a1a3a36a9 baylibre-acme: Use SR_HZ_TO_NS() when configuring the timerfd.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 10:47:38 +02:00
Bartosz Golaszewski 7e5a048ff2 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 <bgolaszewski@baylibre.com>
2015-07-01 00:03:58 +02:00
Daniel Lezcano a0648b1a12 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 <daniel.lezcano@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-07-01 00:00:33 +02:00
Bartosz Golaszewski f9b0ab6b2d 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 <bgolaszewski@baylibre.com>
2015-06-29 16:07:59 +02:00
Daniel Lezcano 4e88b86cc8 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 <daniel.lezcano@free.fr>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-06-29 16:07:52 +02:00
Daniel Elstner fe473123ba 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.
2015-06-27 23:56:37 +02:00
Uwe Hermann a93086528e yokogawa-dlm: Minor cosmetics, consistency fixes, typos. 2015-06-23 00:46:45 +02:00
Soeren Apel 49f49cb55e yokogawa-dlm: Return correct value for SR_CONF_HDIV 2015-06-23 00:15:56 +02:00
Soeren Apel 2dcf82e9cb yokogawa-dlm: Remove dlm_setup_channels() 2015-06-23 00:15:56 +02:00
Soeren Apel c65a021c05 yokogawa-dlm: Introduce config_channel_set() 2015-06-23 00:15:56 +02:00
Soeren Apel f3c60fb6af yokogawa-dlm: Config get/set/list handler updates 2015-06-23 00:15:56 +02:00
Soeren Apel f77afcf0aa yokogawa-dlm: Fix number of digital groups 2015-06-23 00:15:56 +02:00
Soeren Apel 6fd78a9fd0 yokogawa-dlm: Prevent duplicate channel index 2015-06-23 00:15:56 +02:00
Soeren Apel 7048bb1f35 yokogawa-dlm: Add support for the DL9000 series 2015-06-23 00:15:56 +02:00
Daniel Gröber b7c53d48a8 fx2lafw: Add DSLogic Pro and DSCope firmware loading support 2015-06-22 17:14:00 +02:00
Carl-Fredrik Sundström 65e0036635 dslogic: Fix incorrect samplerate setting. 2015-06-22 16:54:39 +02:00
Alexandru Gagniuc aae2273b99 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.
2015-06-16 13:04:24 +02:00
Alexandru Gagniuc 9a5185c736 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.
2015-06-16 13:04:24 +02:00
Alexandru Gagniuc 5281993e0a scpi-pps: Add profile for Chroma 62024P-80-60 DC Source 2015-06-16 13:04:24 +02:00
Jiří Pinkava df705a7af7 Java: install files into DESTDIR
This fixes bug #537.
2015-06-13 17:28:51 +02:00
Uwe Hermann 84ab9da11f saleae-logic16: Emit debug info of which bitstream is used. 2015-06-11 18:35:40 +02:00