Commit Graph

3329 Commits

Author SHA1 Message Date
Uwe Hermann 29ae6f0880 hwdriver.c: Fix key order, add missing items. 2015-08-28 16:29:07 +02:00
Uwe Hermann 607dcdeae1 kern-scale: Add initial driver contents.
This currently supports (and is tested on) the KERN EW 6200-2NM,
other models will be added later.
2015-08-28 11:59:31 +02:00
Uwe Hermann 9380ec2f05 kern-scale: Initial driver skeleton. 2015-08-28 11:43:04 +02:00
Uwe Hermann e5d953b559 Add a protocol parser for KERN scales.
(KERN & SOHN GmbH, http://www.kern-sohn.com/)
2015-08-28 11:43:04 +02:00
Uwe Hermann 34eaf4bcbb output/analog: Support mass related units / MQ flags. 2015-08-28 11:43:04 +02:00
Uwe Hermann 28af4c714e Add a few scale related flags.
- SR_MQ_MASS: Mass, as measured by scales / balances.

 - SR_UNIT_*: Various units of mass.

 - SR_MQFLAG_UNSTABLE: A flag denoting that a value has not
   yet stabilized (settled). E.g. when placing an object on a scale
   it'll take a few moments until a stable reading is available.
   Measurement values marked with SR_MQFLAG_UNSTABLE denote that they
   are "unsettled", unstable values (not yet stabilized).
   The absence of SR_MQFLAG_UNSTABLE denotes that the value is stable.

 - SR_CONF_SCALE: A device class for weighing scales / balances.
2015-08-28 11:43:04 +02:00
Daniel Elstner 68799618f6 Build: Define feature test macro _DEFAULT_SOURCE
This basically makes glibc expose the same set of features as
if gcc was invoked without any restricting -std=c* option. Unlike
_GNU_SOURCE however, it does not enable GNU-specific extensions.

So, with this macro defined the behavior of Linux with glibc
should match that of other platforms.
2015-08-26 13:55:53 +02:00
Daniel Elstner 65489c1ada Build: Use TESTS prefix instead of CHECK for flag variables
In order to avoid confusion of the flags-gathering pkg-config
result with the actual test for the availability of "check",
change the pkg-config output variable prefix from CHECK to TESTS.
2015-08-26 13:13:39 +02:00
Bert Vermeulen a1f7c854c5 Add SR_T_MQLIST.
This type consists of an array, with each item a two-member tuple,
representing an MQ/MQflags pair: the first item is the MQ (type
G_VARIANT_TYPE_UINT32), and the second is the MQ flags value
(G_VARIANT_TYPE_UINT64).

A GVariant of type SR_T_MQLIST can thus always represent more than
one MQ/MQflag pair.
2015-08-26 01:54:34 +02:00
Bert Vermeulen 0176c92fea Add key info tables for MQ and MQflags. 2015-08-26 01:54:34 +02:00
Bert Vermeulen 2fb60e2329 Replace sr_config_info with sr_key_info.
The tables defined with this struct can now be used for information
on items other than config keys.

Functions to access these tables have been renamed sr_key_info_[name_]get.
These take an extra argument, keytype, which should be set to SR_KEY_CONFIG
to get the config key tables. Other key types will be added.
2015-08-26 01:08:42 +02:00
Bert Vermeulen 0b2b92f6c3 scpi/usbtmc: Use sr_usb_close(). 2015-08-25 19:13:17 +02:00
Bert Vermeulen 67e95ed37d Add sr_usb_close(). 2015-08-25 19:13:17 +02:00
Bert Vermeulen 558d438d1f scpi: Strip leading/trailing spaces from *IDN? response. 2015-08-25 19:13:17 +02:00
Bert Vermeulen c0d257790a scpi: Propagate error codes in API functions.
This allows client drivers to detect e.g. timeout conditions.
2015-08-25 19:13:17 +02:00
Bert Vermeulen 9c24d16a1d Make sr_next_enabled_channel() from scpi-pps available library-wide. 2015-08-25 19:13:17 +02:00
Bert Vermeulen 91ef511db2 scpi: Make helper functions from scpi-pps available library-wide. 2015-08-25 19:13:17 +02:00
Bert Vermeulen 5a1afc0907 scpi: Move SCPI-related definitions to separate header file. 2015-08-25 19:13:16 +02:00
Uwe Hermann 64bc73f528 sigrok.m4: License header consistency fixes.
Use the same wording and formatting as in the rest of the codebase.
2015-08-25 17:01:22 +02:00
Daniel Elstner e662d9e8e5 Build: Limit system features to C99 and POSIX
Use -std=c99 to try and enforce standard compliance.
2015-08-25 12:58:39 +02:00
Daniel Elstner 2d2240bb99 Build: Fix SR_CHECK_COMPILE_FLAGS
Do not put "no" into the flags if the check fails.
2015-08-25 00:17:09 +02:00
Daniel Elstner ba1c29dc22 Build: Reduce unnecessary config substitutions
Variable substitutions with a constant value may as well be
set directly in Makefile.am.
2015-08-24 22:20:30 +02:00
Daniel Elstner bc8ff24de6 Build: Leave LIBS alone during configure
Put the extra libraries into SR_EXTRA_LIBS instead of LIBS.
Create an SR_CHECK_LIBS macro to make that easy. Substitute
SR_EXTRA_LIBS into libsigrok.pc, too.
2015-08-24 22:19:05 +02:00
Daniel Elstner 4ed3d9b6db Build: Simplify driver dependency check 2015-08-24 20:15:36 +02:00
Daniel Elstner 2d143826b0 Build: Add private copy of C++11 check macro
Place a copy of ax_cxx_compile_stdcxx_11.m4 from the Autoconf
macro archive into our private m4/ directory. This is cleaner
than trying to parse M4 file versions etc. Plus, the macro is
now always available.
2015-08-24 20:15:20 +02:00
Daniel Elstner 0ab8386a5c Build: Prefer newer versions of libftdi and SWIG 2015-08-24 20:14:57 +02:00
Daniel Elstner 26b67f1141 Build: Use commas to separate missing dependencies
Beautify the output. Also fix the PyGObject test.
2015-08-24 20:14:48 +02:00
Daniel Elstner be21d81a15 Build: Reduce autogen.sh to a trivial stub
Use autoreconf instead of invoking the various Auto tools
separately. Get rid of the Darwin-specific guesswork -- it
does not make sense to handle this at the level of libsigrok.

People should set up their ACLOCAL_PATH themselves as appropriate
for their own system; just as they already need to set up various
other paths.
2015-08-24 20:13:42 +02:00
Daniel Elstner b84a733105 Build: Check for accepted compiler flags
Introduce the SR_CHECK_COMPILE_FLAGS macro and use it to check
for additional compiler flags. Put the accepted flags into the
separate substitution variable SR_EXTRA_CFLAGS.

With this and the preceding changes, bug #578 should now be fixed.
2015-08-24 20:12:47 +02:00
Daniel Elstner 1bb196e496 Build: Move package check macros to m4/sigrok.m4
Define generic macros for pkg-config dependency checks etc. in
m4/sigrok.m4, so they can be easily reused by downstream modules.
2015-08-24 20:10:18 +02:00
Daniel Elstner 4cf2f34f43 Build: Make compiler warnings configurable
Use the SR_ARG_ENABLE_WARNINGS macro to configure and check for
the availability of compiler warning flags. Maintain separate
sets of warning flags for C and C++.

The configure option --enable-warnings=[min|max|fatal|no] can
be used to set the compiler warning level for all languages.
The default level is "max".
2015-08-24 20:08:24 +02:00
Daniel Elstner 24138539c1 Build: Move custom Autoconf macros to separate file
Place custom Autoconf macros which other sigrok modules may
re-use into a separate file m4/sigrok.m4. Also, introduce new
macros for defining the package and library versions, and for
gathering compiler warning flags.
2015-08-24 20:07:01 +02:00
Daniel Elstner 2abad185cd Clean up .gitignore 2015-08-24 20:05:05 +02:00
Daniel Elstner ea1d535145 Build: Place Autoconf macros into m4/ directory
This separates the M4 macros from the other cruft in autostuff/
to prepare for the introduction of custom macro files.
2015-08-24 20:04:29 +02:00
Daniel Elstner cb4d28efd1 Build: Do not omit first argument to m4_warn()
It seems that contrary to what the documentation says, leaving
the category argument to m4_warn() empty is not allowed. Use
the "unsupported" category for lack of a better choice.
2015-08-24 20:04:13 +02:00
Uwe Hermann aafcb3fe87 FreeBSD: Also check for swig3.0.
On FreeBSD (for example) the SWIG binary can also be called "swig3.0".

This fixes (together with the recent "swig2.0" addition) bug #557.
2015-08-19 15:44:43 +02:00
Daniel Elstner a9cb82ace2 Build: Get rid of recursive make invocations
Do not invoke $(MAKE) just to execute some clean rule.
This gets rid of the "jobserver unavailable" warnings.
2015-08-18 21:30:54 +02:00
Daniel Elstner 90420ef6bc Build: Tell setup.py where to find SWIG 2015-08-18 20:14:14 +02:00
Uwe Hermann 3f03ffaf2f FreeBSD: Also check for swig2.0 in addition to swig.
On FreeBSD (for example) the SWIG binary is called "swig2.0".

This fixes bug #557.
2015-08-18 18:28:30 +02:00
Uwe Hermann 731c01f248 FreeBSD: Fix compile/link error due to missing libusb_get_version().
The FreeBSD libusb-1.0 API implementation doesn't have libusb_get_version().
Use our CONF_LIBUSB_1_0_VERSION macro instead.
2015-08-18 18:27:55 +02:00
Daniel Elstner dbde3b6513 Build: Avoid $< in explicit rules
Although useful, makes other than GNU make do not like this.
Name the prerequisite explicitly instead, and circumvent any
VPATH substitution other makes may do.
2015-08-18 18:20:50 +02:00
Daniel Elstner da0763d096 Build: Skip C++ CFLAGS and LIBS check when disabled
It is not a good idea to invoke PKG_CHECK_MODULES with an empty
list of modules to check, so skip the invocation in that case.
2015-08-18 18:20:50 +02:00
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