The glib GTimeVal data type (and some functions using it) will be faded
out from glib sooner or later, so it's not a good idea to use them anyway.
In this specific case GTimeVal.tv_sec was overflowing, leading a check in
libsigrok to fail, and thus to FX2 firmware upload errors, i.e.
non-working fx2lafw devices.
http://thread.gmane.org/gmane.comp.debugging.sigrok.devel/166
The root cause is that GTimeVal.tv_sec is a 'glong' (8 bytes on 64bit
systems, but only 4 on 32bit systems).
We now use an int64_t (and g_get_monotonic_time() instead of the more
problematics g_get_current_time() which uses a GTimeVal).
This has been verified to fix the issue on a 32bit system.
Other uses of GTimeVal in libsigrok will be removed in a later release.
Also, drop unneeded GTV_TO_MSEC.
We no longer expect firmware files to be in the
$prefix/share/libsigrok/firmware directory, as that would require an
additional (distro) package 'sigrok-firmware' or the like to install
files into another package's (libsigrok) path, which can be problematic.
The current 'sigrok-firmware' repo's "make install" will already install
all files into $prefix/share/sigrok-firmware.
If the (generated) ChangeLog file is marked for DISTCLEANFILES, it'll be
removed whenever "make distclean" is called (and is then gone forever if
you use the tarballs, for example).
All ChronoVu LA8 files (*.kdt extension usually) are exactly 8388613
bytes in size (8MB + 5 bytes). Check this, when trying to autodetect the
file format, to reduce the likelihood of 'chronovu-la8' being
autodetected on all binary files (instead of 'binary').
Add ACLOCAL_DIR setting and AM_PROG_AR macro for compiling with Homebrew
under Mac OS X.
Applies essentially the same change to
{libsigrok,libsigrokdecode,sigrok-cli}/{autogen.sh,configure.ac}
It may be that the same fix is needed for the other autogen.sh and/or
configure.ac files, but that hasn't been tested and therefore not in
this commit.
There are various ZEROPLUS models with different probe numbers. For now
hardcode to 16 (for the popular LAP-C(16032)). This will need to be
fixed in a dynamic way later.
This fixes a segfault due to only 16 probe-names being defined, but the
drivers returning 32 as probecount.
Also, add some additional debug output.