Note: This commit is based on the initial implementation by
Christer Ekholm (but stashed into one commit), with some adaptations
(forward porting, coding style and consistency fixes) by Uwe Hermann.
Wolfram Sang [Sun, 21 Feb 2016 09:06:10 +0000 (10:06 +0100)]
session: allocate correct amount of memory in sr_packet_copy
We want the size of the struct, not of a pointer to the struct. And to
be absolutely future proof, dereference the pointer we are assigning the
memory to (not the one we are copying the data from). Found by Coverity,
CID 50858.
Aurelien Jacobs [Mon, 1 Feb 2016 21:37:36 +0000 (22:37 +0100)]
beaglelogic: use standard # operator instead of ugly __STRING macro
Also note that the __ namespace is reserved by POSIX for its private
usage, so user land software should never rely on any kind of API
with a __ prefix.
Uwe Hermann [Fri, 29 Jan 2016 21:57:48 +0000 (22:57 +0100)]
Bump libtool version (not package version) to 3:0:0.
The last release (0.3.0) had the libtool version (current:revision:age)
set to 2:0:0. Since this release adds, removes, and changes interfaces,
the new version is 3:0:0.
For session sources without a file descriptor to poll a negative number
should be passed for the fd parameter. The hung-chang-dso-2100 driver
currently passes 0 instead, which is the stdin stream. Fix the issue by
passing -1 for the fd parameter.
Wolfram Sang [Sat, 9 Jan 2016 07:17:57 +0000 (08:17 +0100)]
input: vcd: avoid needless copying
Current code moves the identifier string one byte to the front to
overwrite the bit value, so 'tokens[i]' is a string to compare against
the desired value. This copying is unnecessary, just pass a properly
setup pointer.
Wolfram Sang [Sat, 9 Jan 2016 17:27:14 +0000 (18:27 +0100)]
input: vcd: try to continue when a vector was found
No need to bail out on vectors. As long as there are tokens left, we can
try to parse the rest. Also, print a message so the user knows what's
going on. Here is a testcase vcd:
Wolfram Sang [Sat, 9 Jan 2016 16:40:10 +0000 (17:40 +0100)]
input: vcd: properly bail out on missing identifiers
If we hit the missing identifier case, then we reached the end of the
token list. So, we should break out of the loop, and not continue.
Otherwise we will go past the end of the array as this minimal testcase
shows:
Soeren Apel [Fri, 8 Jan 2016 22:00:55 +0000 (23:00 +0100)]
Trace32 import module: Send trigger only once
As we're downsampling, several record time stamps can match the specified
trigger time. For this reason, it's possible that several trigger packets
are sent when a file is loaded. This prevents the issue and sends a
trigger packet only on the first matching record.
Uwe Hermann [Thu, 7 Jan 2016 22:22:42 +0000 (23:22 +0100)]
lecroy-logicstudio: Fix some compiler warnings on MinGW.
src/hardware/lecroy-logicstudio/protocol.c: In function 'handle_fetch_samples_done':
src/hardware/lecroy-logicstudio/protocol.c:261:3: warning: passing argument 6 of 'libusb_fill_bulk_transfer' from incompatible pointer type
recv_bulk_transfer, (void *)sdi, USB_TIMEOUT_MS);
^
In file included from ./src/libsigrok-internal.h:31:0,
from src/hardware/lecroy-logicstudio/protocol.h:26,
from src/hardware/lecroy-logicstudio/protocol.c:23:
/home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1546:20: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
^
src/hardware/lecroy-logicstudio/protocol.c: In function 'fetch_samples_async':
src/hardware/lecroy-logicstudio/protocol.c:314:4: warning: passing argument 6 of 'write_registers_async' from incompatible pointer type
handle_fetch_samples_done);
^
src/hardware/lecroy-logicstudio/protocol.c:200:12: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
static int write_registers_async(const struct sr_dev_inst *sdi,
^
src/hardware/lecroy-logicstudio/protocol.c: In function 'lls_start_acquisition':
src/hardware/lecroy-logicstudio/protocol.c:1122:3: warning: passing argument 6 of 'libusb_fill_interrupt_transfer' from incompatible pointer type
recv_intr_transfer, (void *) sdi, USB_TIMEOUT_MS);
^
In file included from ./src/libsigrok-internal.h:31:0,
from src/hardware/lecroy-logicstudio/protocol.h:26,
from src/hardware/lecroy-logicstudio/protocol.c:23:
/home/uwe/sr_mingw/include/libusb-1.0/libusb.h:1602:20: note: expected 'libusb_transfer_cb_fn' but argument is of type 'void (*)(struct libusb_transfer *)'
static inline void libusb_fill_interrupt_transfer(
^
Wolfram Sang [Sun, 3 Jan 2016 21:27:43 +0000 (22:27 +0100)]
dmm: vc870: render POWER_FACTOR as such and not as frequency
The primary display is the power factor, the secondary is the frequency.
This got mixed up, so change the order. We also need to fix the
conversion factor.
Wolfram Sang [Sun, 3 Jan 2016 21:27:42 +0000 (22:27 +0100)]
dmm: vc870: keep the order when processing modes
is_power_apparent_power is index 0 of function 0x39, so it is better to
process it first and the later indices after that (we need to add
another one with a different patch later).
Wolfram Sang [Sun, 3 Jan 2016 21:27:40 +0000 (22:27 +0100)]
dmm: vc870: show display value properly in debug output
It was confusing to see the display value (5 digits) printed in debug
output as a float. Print it the same way as shown on the real device,
without comma, of course.
This also allows to simplify the code a little.
Martin Ling [Mon, 2 Nov 2015 00:40:40 +0000 (00:40 +0000)]
Add new sr_dev_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_DEVICE_OPTIONS to obtain a list of device options. Note
that this does not include the SR_CONF_{GET,SET,LIST} bitmask,
which is now retrieved for a specific key by calling
sr_dev_config_capabilties().
Uwe Hermann [Fri, 25 Dec 2015 22:20:00 +0000 (23:20 +0100)]
korad-kaxxxxp: Add workaround for a Korad KA3005P issue.
In some situations, the reply to the *IDN? command contains an
additional trailing 0x01 byte for unknown reasons.
This issue seems to be reproducible by changing the voltage using the knobs
on the device, then turning on the output and turning it off again.
The next korad-kaxxxxp scan() operation would contain the trailing 0x01
byte, which would lead to the detection of the device in libsigrok no
longer working until the next power-cycle.
Work around this issue by treating both the ID string with and without
the trailing 0x01 byte as valid.
Daniel Elstner [Tue, 22 Dec 2015 14:52:40 +0000 (15:52 +0100)]
sysclk-lwla: Attempt initialization three times
This is a desperate measure to improve the success rate of device
initialization even after it got into a bad state. Combine this
with a reduced USB timeout (1 second) so that if it fails, it fails
quickly. Also ignore USB errors from the initial dummy read of the
device test ID.
Daniel Elstner [Sat, 5 Dec 2015 16:47:52 +0000 (17:47 +0100)]
sysclk-lwla: Work around short transfer quirk
Detect whether the FX2 firmware of the LWLA device exhibits the
short transfer bug. If so, work around the problem by limiting
reads to at most 64 bytes at a time. This slows down the memory
read after acquisition quite noticably, but makes the device
usable even in adverse conditions.
Daniel Elstner [Sat, 5 Dec 2015 09:06:15 +0000 (10:06 +0100)]
sysclk-lwla: Skip unused registers in status poll
Reduce the number of long registers read in bulk during status
polling from 10 to 5. The LWLA1034 driver used to do that already
in an earlier iteration, which was then changed to be more like
the original vendor software. The reason for bringing it back now
is that it reduces the response size to 40 bytes, which works
around the spurious 64 byte limit bug in the FX2 firmware of the
LWLA devices.
Stefan Brüns [Sat, 28 Nov 2015 15:52:08 +0000 (16:52 +0100)]
input/wav: initialize channel list before going into ready state
The sr_input_dev_inst_get API documentation guarantees an input is fully
initialized as soon as the device instance is returned. An sdi
implementation should not set sdi_ready any earlier.
Marcus Comstedt [Sun, 8 Nov 2015 16:37:34 +0000 (17:37 +0100)]
bindings: Fix doc extraction for enums
The source file enum.hpp was not found when not building in the source
tree. Also, extraction of the brief description did not work correctly
when there was additional XML markup inside the <para> element.
Hannu Vuolasaho [Fri, 27 Nov 2015 18:10:14 +0000 (20:10 +0200)]
korad-kaxxxxp: Workaround for Korad device bug
The sixth character from ISET? is read and discarded. If the device is
turned off and on again, this won't be there and causes 10 ms delay in
every ISET? Luckily, this value isn't queried that often. To get the
sixth byte, the *IDN? command has to be issued before ISET?.