Commit Graph

3287 Commits

Author SHA1 Message Date
Daniel Elstner b8b727e45f Build: Fix typo that broke the driver enable options 2015-08-18 18:20:50 +02:00
Daniel Elstner d37c7109bf Build: Make SR_DRIVER() handle dependencies
Turn the hardware driver dependency handling on its head, by
making SR_DRIVER() take a list of dependencies to check for.
2015-08-18 18:20:50 +02:00
Daniel Elstner 7c16e74d45 Build: Make dependency on git change more robust
It can sometimes happen that .git/HEAD or .git/refs/head/*, which
are added as config.status dependencies during configure, do not
exist anymore at build time.  For instance, when the current branch
is deleted after switching to a different one.

Wrap the dependencies inside $(wildcard ...) to avoid this problem.
Note that this is a GNU make feature.  However, it should be fine
as it is only used for git builds.  Even if a non-GNU make is used,
the construct will hopefully just expand to nothing.
2015-08-18 18:20:50 +02:00
Uwe Hermann 965d68898a Build: Show glib/libzip version requirements in configure summary. 2015-08-16 23:56:43 +02:00
Uwe Hermann 2700e63d48 Build: Fix a typo causing libftdi1 detection issues. 2015-08-16 23:53:23 +02:00
Daniel Elstner 2cbde15198 Build: Properly namespace the version defines
Use the CONF_ prefix for the configured host define as well as
the various build-time version macros.
2015-08-16 18:53:32 +02:00
Daniel Elstner 1f61c22ff5 Build: Cleanup up and modernize autotools setup
Note that some --enable options of configure have become
--with or --without options.
2015-08-16 18:28:13 +02:00
Daniel Elstner c5f179a975 Build: Simplify the hardware driver selection
Replace DRIVER() and DRIVER2() by a single SR_DRIVER() macro.
Derive the names of shell variables and preprocessor defines
programatically to cut down on repetition.
2015-08-16 18:28:13 +02:00
Daniel Elstner 7e2cadd003 Add dist tarball to gitignore 2015-08-16 18:28:13 +02:00
Daniel Elstner 5a3e34285d setup.py: Do VPATH search for swig/enums.i
Also, in swig/classes.i include swig/enums.i rather than plain
enums.i, to guard against future name clashes.
2015-08-16 18:28:13 +02:00
Daniel Elstner cf5b338e07 Build: Depend on swig/enums.i where appropriate 2015-08-16 18:28:13 +02:00
Daniel Elstner bc81463bb8 enums.py: Place swig/enums.i into build directory 2015-08-16 18:28:13 +02:00
Daniel Elstner 122322a9ba Build: Do not distribute generated headers
version.h and enums.hpp are generated at build time and should
not be included in the distribution tarball.  This seems to have
triggered a weird error when doing a VPATH build of the dist
tarball.
2015-08-16 18:28:13 +02:00
Daniel Elstner 9ac018d0fc Build: Pass nostdinc option to automake
It seems automake automatically adds the directory containing
the generated version.h to the include path.  Use nostdinc to
disable default includes altogether.
2015-08-16 18:28:13 +02:00
Daniel Elstner b5f0731971 Build: Use angle brackets for enums.cpp include 2015-08-16 18:28:13 +02:00
Daniel Elstner 31ac7735ea Build: Distribute bindings sources
A couple of files referenced during the build were missing from
the distribution, causing a tarball build failure.
2015-08-16 18:28:13 +02:00
Daniel Elstner 8b2a184327 Build: Prefix directory to include of enums.hpp
This fixes a build problem due to the reduced include search paths
introduced by my recent changes.  Also fix a couple of other
includes to use angle brackets.
2015-08-16 18:28:13 +02:00
Daniel Elstner 7f289d14ec Build: Append git revision hash to version
Append the git revision hash to the libsigrok package version,
unless HEAD exactly matches a release tag.  Note that this does
not affect the version known to autoconf -- e.g. source tarballs
created by make dist will not receive a revision suffix.

Changes to git HEAD automatically trigger a reconfiguration.
Uncommitted changes do not, which is why I left out the -dirty
suffix.
2015-08-16 18:28:13 +02:00
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