Commit Graph

3819 Commits

Author SHA1 Message Date
Wolfram Sang b84f91ff2e 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.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-02-28 18:21:18 +01:00
Uwe Hermann 2217be1dd4 arachnid-labs-re-load-pro: Handle undervoltage condition.
Support the SR_CONF_UNDER_VOLTAGE_CONDITION* keys.

Undervoltage (and overtemperature) conditions now emit a
warning-level message as well.
2016-02-11 14:42:50 +01:00
Uwe Hermann 2fe1011f1d Add SR_CONF_UNDER_VOLTAGE_CONDITION* config keys.
Add two new config keys:

 - SR_CONF_UNDER_VOLTAGE_CONDITION

 - SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE
2016-02-11 14:42:50 +01:00
Uwe Hermann 8084e0fa81 arachnid-labs-re-load-pro: Only support firmware >= 1.10.
The "on\n" and "off\n" commands require this.
2016-02-11 14:42:50 +01:00
Uwe Hermann 8501448cfe arachnid-labs-re-load-pro: Add support for setting SR_CONF_ENABLED.
The firmware has "on\n" and "off\n" commands since 1.10, so use them.

Apparently you can only set the state (on/off) of the load, but it's
not possible to query the current state.
2016-02-11 14:42:50 +01:00
Uwe Hermann 6e68da5140 arachnid-labs-re-load-pro: Convert to SR_DF_ANALOG. 2016-02-11 14:42:50 +01:00
Uwe Hermann 803db07a1a arachnid-labs-re-load-pro: Add initial driver. 2016-02-08 15:02:29 +01:00
Uwe Hermann 6e8d31d468 arachnid-labs-re-load-pro: Initial driver skeleton. 2016-02-08 15:02:29 +01:00
Aurelien Jacobs 83bf4762e4 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.
2016-02-06 17:24:34 +01:00
Uwe Hermann 29d3876a0b configure.ac: Bump package version to 0.5.0.
0.5.0 will be the next major, API-changing release. Bump now, so that
there is no confusion of tarball 0.4.0 and 0.5.0-git snapshots.
2016-02-06 15:19:06 +01:00
Uwe Hermann 89c82260b0 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.

http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info

This changes the library filename (e.g. on Linux) from libsigrok.so.2.0.0
to libsigrok.so.3.0.0, the SONAME (+symlink) becomes libsigrok.so.3.
2016-01-29 23:23:06 +01:00
Uwe Hermann 18b9bbb39c NEWS: Update for upcoming 0.4.0 release. 2016-01-29 23:23:06 +01:00
Soeren Apel 10c4ca9c5b hameg-hmo/yokogawa-dlm: Fix warning about pointer typecast 2016-01-29 23:13:32 +01:00
Soeren Apel a084a8f2a4 SCPI: Do not use RL1 lockout for Yokogawa devices 2016-01-29 21:59:06 +01:00
Soeren Apel b18b8a9202 yokogawa-dlm: Fix array_float_get() 2016-01-29 21:39:20 +01:00
Soeren Apel 8cccbac8da hameg-hmo: Fix array_float_get() and also use it for the time base 2016-01-29 21:35:16 +01:00
Soeren Apel fe227d17ae hameg-hmo: Add missing 20/50V vdiv entries 2016-01-29 21:13:07 +01:00
Soeren Apel e786b19467 hameg-hmo: Add more supported scope models 2016-01-29 21:08:49 +01:00
Uwe Hermann b90400ed89 README: Bump bindings requirements to the upcoming 0.4.0 release. 2016-01-29 18:31:00 +01:00
Uwe Hermann db5449b918 README: Mention the missing libieee1284 requirement. 2016-01-29 18:30:32 +01:00
Lars-Peter Clausen b165a24234 hung-chang-dso-2100: Fix session source fd
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.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2016-01-29 18:24:42 +01:00
Uwe Hermann eb8e6cd2cb Use libusb_error_name() more often for better diagnostics. 2016-01-29 18:00:11 +01:00
Aurelien Jacobs 9dfacd8706 demo: fix infinite loop with 0 channels of one type
The following command line exhibits the inifinit loop:
  sigrok-cli -d demo:analog_channels=0 --samples=8
2016-01-28 23:41:19 +01:00
Aurelien Jacobs e922790220 configure: replace buggy AX_RUBY_EXT by a proper implementation
This actually allows to get the proper DLEXT expected by Ruby on
the target system.
2016-01-28 22:48:44 +01:00
Aurelien Jacobs e469259a57 configure: check for swig version >= 3.0.8 for Ruby bindings 2016-01-28 22:45:28 +01:00
Wolfram Sang 3f48fc82b5 input: vcd: by default do not limit number of channels
Accept (and set to default) 0 for numchannels which means 'unlimited'.
I think it is convenient to read all channels of a vcd file by default.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang ab464eb3dc input: vcd: register channels when parsing header not when initializing
Benefits:

* only channels really used in vcd will be added
* we can give them the proper name found in the vcd file
* less code :)

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 34724ffa34 input: vcd: support 1 bit vectors
Use the new process_bit() function to parse 1 bit vectors, too.

This is the first step to fix bug #723. Minimal testcase vcd:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$var wire 1 n1 addr_1 $end
$enddefinitions $end
#0
0n0
b1 n1
#1
1n0
b0 n1
#2
0n0
b1 n1
#3
1n0
b0 n1

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 36dacf17bc input: vcd: refactor parsing a bit
Move to a separate function which we want to reuse later.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang a66175c2b1 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.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 76bc28c3f1 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:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$var wire 1 n1 addr_1 $end
$enddefinitions $end
#0
0n0
b1 n1
#1
1n0
b0 n1
#2
0n0
b1 n1

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang 73f052d329 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:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$enddefinitions $end
1

gives:

$ ./sigrok-cli -I vcd -i no_mod.vcd -O vcd -o /tmp/o.vcd
Segmentation fault

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Wolfram Sang e85e550d92 input: vcd: allow optional index item
A $var block can have an optional index item which looks like '[<sth>]'.
Parse it, too, and append it to the channel name.

This fixes bug #322. A first version was posted by Simon Richter. This
version is rebased and simplified.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-01-28 19:03:53 +01:00
Uwe Hermann 650847e7d3 hameg-hmo: Fix some compiler warnings. 2016-01-28 19:03:53 +01:00
Soeren Apel 8fff75196f hameg-hmo: Replace floating point comparison for vdiv
This should fix bug #731.
2016-01-28 19:03:53 +01:00
Soeren Apel a5be5d5bc0 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.
2016-01-28 19:03:52 +01:00
Aurelien Jacobs 27d44cf6e0 Implement Ruby bindings on top of SWIG/C++ bindings. 2016-01-28 19:03:52 +01:00
Aurelien Jacobs 0441038e2f Makefile: use PYSIGROK_FLAGS only for building python bindings 2016-01-11 16:25:35 +01:00
Uwe Hermann 1b4aedc06f Use ALL_ZERO in a few more places. 2016-01-07 23:50:17 +01:00
Uwe Hermann ff7c7cda93 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(
                    ^
2016-01-07 23:50:17 +01:00
Uwe Hermann d64b5f43cc sysclk-lwla: Minor whitespace and consistency fixes. 2016-01-07 23:50:17 +01:00
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