Commit Graph

3728 Commits

Author SHA1 Message Date
Uwe Hermann 0cadb8a350 Minor whitespace and cosmetic fixes. 2016-01-07 23:50:17 +01:00
Wolfram Sang 3591481e87 dmm: vc870: drop unused variable
There is no status bit for RMS. We know about RMS if certain modes are
active. So, drop this superfluous variable.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang ee2e9be21b dmm: vc870: support effective voltage & current
And rename the status variable because in sigrok the term RMS is used
instead of "effective value".

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang 2e1c4817c7 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.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang 4867dd177f 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).

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang b4a0770ef8 dmm: vc870: fix AC conversion factors
Testing showed that AC current needs to be handled different from DC.
Note that ACA is still untested because of limited testing equipment.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Wolfram Sang b89462e457 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.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-05 22:25:29 +01:00
Daniel Elstner 32ba0d8005 resource: Replace ssize_t with gssize to avoid unistd.h 2016-01-04 20:53:30 +01:00
Martin Ling c61e208d26 python: Provide sensible __str__ and __repr__ functions for enum values.
This fixes bug #668.
2016-01-04 20:49:35 +01:00
Uwe Hermann f014a8fd4c proto.h: Add missing unistd.h #include.
The ssize_t and size_t usage requires the unistd.h #include.

Thanks to Daniel Glöckner for the bug report.

This fixes bug #721.
2016-01-03 03:00:45 +01:00
Uwe Hermann e43887683c baylibre-acme: Replace g_close() with close() for now.
This g_close(), the only one in the whole code-base, would unnecessarily
raise the minimum glib version to 2.36.

Thanks to Daniel Glöckner for the report.

This fixes bug #724.
2016-01-03 02:59:00 +01:00
Daniel Elstner 8c52989811 C++: Avoid std::map::emplace() for GCC 4.7 compatibility
This fixes bug #720.
2016-01-03 00:51:37 +01:00
Uwe Hermann 6954fdbca9 src/backend.c: Add missing winsock2.h #include. 2016-01-03 00:39:44 +01:00
Martin Ling fa69e191b2 win32: Call WSAStartup() at sr_init() time.
Should fix bug #692.
2016-01-02 17:40:00 +01:00
Uwe Hermann 8141a0325c Rename sr_driver_scan_options() to sr_driver_scan_options_list(). 2015-12-31 19:04:34 +01:00
Uwe Hermann 0c697a4b33 Rename sr_dev_config_capabilities() to sr_dev_config_capabilities_list(). 2015-12-31 19:04:28 +01:00
Uwe Hermann 7d7fd93c94 Restore number "categories" in sr_configkey. 2015-12-31 19:00:16 +01:00
Martin Ling e318f01b2f Make SR_CONF_MASK an internal constant. 2015-12-31 19:00:16 +01:00
Martin Ling cffdc3e63b Make SR_CONF_{SCAN,DEVICE}_OPTIONS into internal constants.
These are no longer needed in the public API as we have new wrapper functions.
They are still used internally by drivers.
2015-12-31 19:00:16 +01:00
Martin Ling 36bb818d6f bindings: New configuration enumeration API.
The new methods wrap the new libsigrok C API helper functions and eliminate
the need to pass complex types back to the user and wrap them with SWIG.

Fixes bugs #479 and #480.
2015-12-31 19:00:16 +01:00
Martin Ling 8f3168b89b Add new sr_driver_scan_options() helper function.
This function replaces the pattern of calling config_list() with
SR_CONF_SCAN_OPTIONS to obtain a list of scan options.
2015-12-31 19:00:16 +01:00
Martin Ling e7136c626f 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().
2015-12-31 19:00:16 +01:00
Martin Ling 71e9c54dab Add new sr_dev_config_capabilities() helper function. 2015-12-31 19:00:15 +01:00
Martin Ling 12f2f640cb bindings: Wrap enum sr_configcap as Capability class. 2015-12-31 18:27:56 +01:00
Martin Ling c57aa1ac19 Make SR_CONF_{GET,SET,LIST} into a new enum. 2015-12-31 18:27:56 +01:00
Uwe Hermann 039a2fd78a src/usb.c: Only allow hex characters in CONN_USB_VIDPID.
(and also allow case-insensitive specification)

Thanks to Hannu Vuolasaho for the fix.
2015-12-29 13:21:01 +01:00
Wolfram Sang 52fb2d4484 modbus: silence a build warning
Refactor handling the size of modbus_devs, so it doesn't produce a build
warning and still allows the compiler to remove unused code.

This fixes bug #637. It could be reverted once modbus_devs
unconditionally has a member in the struct.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-12-29 13:19:36 +01:00
Uwe Hermann 0a1f7b09b3 Prefer postfix-increment for consistency across the code-base.
Only when there are technical reasons use prefix-increment.
2015-12-26 14:37:33 +01:00
Uwe Hermann a078d3ec52 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.
2015-12-25 23:29:35 +01:00
Uwe Hermann ae9ca5b1df korad-kaxxxxp: Add support for the Velleman PS3005D. 2015-12-24 01:19:11 +01:00
Daniel Elstner 1d80e1c641 sysclk-lwla: Use static array for LWLA1034 init sequence
Just as in the LWLA1016 initialization, make use of a static array
for the constant part of the LWLA1034 capture setup sequence.
2015-12-22 23:42:36 +01:00
Daniel Elstner e35a459248 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.
2015-12-22 16:09:39 +01:00
Daniel Elstner 04f2428354 sysclk-lwla: Use static array for init sequence 2015-12-22 16:09:39 +01:00
Daniel Elstner 786485772f 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.
2015-12-22 16:09:39 +01:00
Daniel Elstner 940805ce7d 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.
2015-12-22 16:09:39 +01:00
Daniel Elstner ef7df53d36 sysclk-lwla: Declare model_info structs as extern
This fixes bug 714.
2015-12-22 16:08:18 +01:00
Daniel Elstner fc6cbfce2b sysclk-lwla: Close USB handle on drain error 2015-12-21 17:56:52 +01:00
Daniel Elstner 407b6e2cff sysclk-lwla: Various cosmetic improvements 2015-12-21 17:56:52 +01:00
Soeren Apel 6d2897e394 Add the Lauterbach Trace32 logic analyzer data import module 2015-12-21 16:32:49 +01:00
Soeren Apel 8a66b0777c Add RL64 and RL64S endianness helper macros 2015-12-21 16:23:44 +01:00
Soeren Apel d01c4c56d5 Whitespace fixes 2015-12-21 16:23:44 +01:00
Uwe Hermann 30726a8a32 input/raw_analog: Fix two compiler warnings.
../src/input/raw_analog.c:63:67: warning: integer overflow in expression [-Woverflow]
  { "S32_LE",     { 4, TRUE,  FALSE, FALSE, 0, TRUE, { 1, INT32_MAX+1}, { 0, 1}}},
                                                                   ^
../src/input/raw_analog.c:65:67: warning: integer overflow in expression [-Woverflow]
  { "S32_BE",     { 4, TRUE,  FALSE, TRUE,  0, TRUE, { 1, INT32_MAX+1}, { 0, 1}}},
                                                                   ^
2015-12-21 16:23:39 +01:00
Uwe Hermann 21cbe810fe input/raw_analog: Use ARRAY_SIZE. 2015-12-21 16:10:20 +01:00
Stefan Brüns 221cec31fc input/raw_analog: set scale and offset appropriately 2015-12-21 15:56:31 +01:00
Stefan Brüns e6b15cb5e6 input/raw_analog: Add input module for raw analog signals 2015-12-21 15:56:31 +01:00
Stefan Brüns 4d376e082c analog: add conversion from various integer formats to float 2015-12-21 15:53:01 +01:00
Stefan Brüns 74c9a8d2bd 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.

This fixes parts of bug #387.
2015-12-21 15:37:32 +01:00
Stefan Brüns 7cccc9155c bindings/cxx: make sure the config value reference is kept
fixes glib warning:
GLib-CRITICAL **: g_variant_unref: assertion 'value->ref_count > 0' failed
2015-12-04 23:18:14 +01:00
Tilman Sauerbeck 8dd5d426f7 z60_libsigrok.rules: Add udev rule for LeCroy LogicStudio16. 2015-12-04 10:35:04 +01:00
Tilman Sauerbeck c7b17bcba3 lecroy-logicstudio: Initial driver implementation.
This supports both 8 and 16 channel modes with samplerates up to
500 MHz. Voltage thresholds are currently fixed at 1.58V.
2015-12-04 10:35:04 +01:00