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?.
Stefan Brüns [Thu, 26 Nov 2015 02:07:47 +0000 (03:07 +0100)]
output/analog: track and free memory for float conversion buffer
==18779== 800,000 bytes in 196 blocks are definitely lost in loss record 29 of 29
==18779== at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18779== by 0x4E635C3: receive (analog.c:319)
==18779== by 0x40870B: datafeed_in (session.c:316)
==18779== by 0x4E59D4E: sr_session_send (session.c:1201)
==18779== by 0x4E59F8B: sr_session_send (session.c:1159)
==18779== by 0x4E62595: send_chunk (wav.c:234)
==18779== by 0x4E62A06: process_buffer (wav.c:290)
==18779== by 0x40954A: load_input_file_module (input.c:123)
==18779== by 0x4097AB: load_input_file (input.c:157)
==18779== by 0x40531E: main (main.c:288)
Stefan Brüns [Thu, 26 Nov 2015 02:04:39 +0000 (03:04 +0100)]
session: free memory for datafeed callbacks, reported by valgrind
==17549== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 39
==17549== at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17549== by 0x5359200: g_malloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549== by 0x536EE2D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549== by 0x5370165: g_slist_append (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549== by 0x4E595C3: sr_session_datafeed_callback_add (session.c:512)
==17549== by 0x409527: load_input_file_module (input.c:111)
==17549== by 0x4097AB: load_input_file (input.c:157)
==17549== by 0x40531E: main (main.c:288)
Stefan Brüns [Thu, 26 Nov 2015 01:30:42 +0000 (02:30 +0100)]
session: fix use after free of session->devs as reported by valgrind
==7478== Invalid write of size 8
==7478== at 0x4E59182: sr_session_dev_remove_all (session.c:302)
==7478== by 0x4E591CD: sr_session_destroy (session.c:265)
==7478== by 0x4095D9: load_input_file_module (input.c:143)
==7478== by 0x4097AB: load_input_file (input.c:157)
==7478== by 0x40531E: main (main.c:288)
==7478== Address 0x7877eb8 is 88 bytes inside a block of size 96 free'd
==7478== at 0x4C2A37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7478== by 0x4E5F454: sr_input_free (input.c:573)
==7478== by 0x4095C3: load_input_file_module (input.c:140)
==7478== by 0x4097AB: load_input_file (input.c:157)
==7478== by 0x40531E: main (main.c:288)
Daniel Elstner [Fri, 27 Nov 2015 13:32:28 +0000 (14:32 +0100)]
sysclk-lwla: Cut down on size_t overuse
Do not use size_t for values whose width is defined by the device,
not the host. Also don't use size_t for simple indices with known
small range, unless type compatibility considerations apply.
Daniel Elstner [Sun, 22 Nov 2015 16:45:54 +0000 (17:45 +0100)]
sysclk-lwla: Implement support for LWLA1016
Refactor the sysclk-lwla driver to separate the generic logic from
the model-specific implementation. Based on this, implement support
for the SysClk LWLA1016 device.
Uwe Hermann [Sat, 21 Nov 2015 19:27:25 +0000 (20:27 +0100)]
sr_usb_find(): Increase the 'bus' limit to 255.
On some systems it can happen that the USB 'bus' number is a lot larger
than 64, but sr_usb_find() currently errors out if it is > 64.
Example:
Bus 250 Device 006: ID 1ab1:04ce 1ab1 DS1000Z Series[...]
Increase that limit so that the code will work everywhere. This bus number
is queried via libusb_get_bus_number() which returns an uint8_t, so we're
limiting to 255 here.