Commit Graph

3236 Commits

Author SHA1 Message Date
Daniel Lezcano 4e88b86cc8 baylibre-acme: Optimize reading of values from sysfs.
Opening a file has a cost (security, allocation, syscalls). The
read_sample() function always does an open/read/close sequence.

In order to optimize that, let's open the file at the moment the
acquisition starts, close it when the acquisition stops and make
read_sample() only lseek() to the beginning of the file and read
the value.

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-06-29 16:07:52 +02:00
Daniel Elstner fe473123ba sysclk-lwla: Do not create channels in reverse order
This was originally done as an optimization in combination with a list
reversal which has since been removed from the code.  Thus, un-reverse
the channels so that the UI lists them in the correct order again.
2015-06-27 23:56:37 +02:00
Uwe Hermann a93086528e yokogawa-dlm: Minor cosmetics, consistency fixes, typos. 2015-06-23 00:46:45 +02:00
Soeren Apel 49f49cb55e yokogawa-dlm: Return correct value for SR_CONF_HDIV 2015-06-23 00:15:56 +02:00
Soeren Apel 2dcf82e9cb yokogawa-dlm: Remove dlm_setup_channels() 2015-06-23 00:15:56 +02:00
Soeren Apel c65a021c05 yokogawa-dlm: Introduce config_channel_set() 2015-06-23 00:15:56 +02:00
Soeren Apel f3c60fb6af yokogawa-dlm: Config get/set/list handler updates 2015-06-23 00:15:56 +02:00
Soeren Apel f77afcf0aa yokogawa-dlm: Fix number of digital groups 2015-06-23 00:15:56 +02:00
Soeren Apel 6fd78a9fd0 yokogawa-dlm: Prevent duplicate channel index 2015-06-23 00:15:56 +02:00
Soeren Apel 7048bb1f35 yokogawa-dlm: Add support for the DL9000 series 2015-06-23 00:15:56 +02:00
Daniel Gröber b7c53d48a8 fx2lafw: Add DSLogic Pro and DSCope firmware loading support 2015-06-22 17:14:00 +02:00
Carl-Fredrik Sundström 65e0036635 dslogic: Fix incorrect samplerate setting. 2015-06-22 16:54:39 +02:00
Alexandru Gagniuc aae2273b99 bindings/python: Handle import failures without crashing
When the import of gi.repository.GLib failed, we would get a NULL
pointer that we passed along without any checking. In this situation,
the entire program would crash with a segmentation fault, and no
message to indicate the problem.

When the import fails, abort the SWIG init and print a message. The
Python interpreter then prints out a backtrace, which can be useful
in tracking down the problem.
2015-06-16 13:04:24 +02:00
Alexandru Gagniuc 9a5185c736 scpi-pps: Chroma 62000P: Get capabilities from device name
The Chroma 62000P series comes in various models with different
current and voltage capabilities. These are encoded in the *IDN
string, so just get them from there, rather than needing a profile
for every model.
2015-06-16 13:04:24 +02:00
Alexandru Gagniuc 5281993e0a scpi-pps: Add profile for Chroma 62024P-80-60 DC Source 2015-06-16 13:04:24 +02:00
Jiří Pinkava df705a7af7 Java: install files into DESTDIR
This fixes bug #537.
2015-06-13 17:28:51 +02:00
Uwe Hermann 84ab9da11f saleae-logic16: Emit debug info of which bitstream is used. 2015-06-11 18:35:40 +02:00
Marcus Comstedt c868139629 saleae-logic16: Support new bitstream version 1.3 with renumbered registers 2015-06-11 18:35:40 +02:00
Uwe Hermann da005885c8 scpi: Update names of a few *_OUTPUT_* items. 2015-06-07 20:58:46 +02:00
Uwe Hermann ae1827f557 modbus: Consistently use the "Modbus" spelling.
(as per modbus.org spelling)
2015-06-07 20:42:33 +02:00
Uwe Hermann f54ebe0c06 modbus: Minor typos, cosmetics and consistency fixes. 2015-06-07 20:40:32 +02:00
Aurelien Jacobs ffb580cf73 Actual implementation for the maynuo-m97 driver. 2015-06-07 20:15:08 +02:00
Aurelien Jacobs e1ccfb1910 maynuo-m97: Initial driver skeleton. 2015-06-07 20:15:08 +02:00
Aurelien Jacobs e77e32a3be libsigrok.h: add new type of device: ELECTRONIC_LOAD. 2015-06-07 20:15:08 +02:00
Aurelien Jacobs c4b7838922 libsigrok.h: Add SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE. 2015-06-07 20:15:07 +02:00
Aurelien Jacobs 4c938fc27f modbus: add a serial RTU backend. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs daa3901205 Add a modbus communication helper module. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs a2632bcafc libsigrok-internal.h: add helper macro to read floats from unaligend memory. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs 7a0b98b544 Rename SR_CONF_OUTPUT_* to SR_CONF_*.
All those options are currently applied only to power-supplies
but they could apply as well to electronic loads, except for the
fact that electronic loads channels are called inputs and not
outputs.
Also when you think about an SMU (or any kind of 4-quadrants
power-supply), their channels can both source and sink current,
so they can be considered as input as much as output.
Those SR_CONF_* are thus renamed so that they can be used in all
those situations.
2015-05-12 13:22:34 +02:00
Aurelien Jacobs c1603f4574 scpi-pps: don't fail acquisition start for devices with no CMD_SELECT_CHANNEL
For devices such as the HP 6632B the following invocation was failing due to
scpi_cmd(sdi, SCPI_CMD_SELECT_CHANNEL, ...) returning SR_OK_CONTINUE.

./sigrok-cli -d scpi-pps:conn=/dev/ttyUSB0:serialcomm=9600/8n1 --continuous
sr: session: sr_session_start: could not start an acquisition (not enough data to decide error status yet)
Failed to start session.
2015-05-09 23:06:10 +02:00
Aurelien Jacobs bbc42811d0 Use G_PI instead of defining our own version of PI. 2015-05-09 22:52:24 +02:00
Uwe Hermann 562a34908e scpi-pps: Minor cleanups. 2015-05-07 03:15:35 +02:00
Uwe Hermann c80cf3e02e scpi-pps: Fix a compiler warning.
CC       src/hardware/scpi-pps/profiles.lo
  src/hardware/scpi-pps/profiles.c:67:2: warning: missing initializer
  for field 'frequency' of 'const struct channel_spec'
  [-Wmissing-field-initializers]
    { "1", { 0, 60, 0.0001 }, { 0, 25, 0.1 } },
    ^
  In file included from src/hardware/scpi-pps/profiles.c:24:0:
  src/hardware/scpi-pps/protocol.h:106:8: note: 'frequency' declared
  here
    float frequency[3];
          ^
2015-05-07 02:59:28 +02:00
Uwe Hermann 8cb5affe00 scpi-pps: Make some more items static. 2015-05-07 02:49:59 +02:00
Alexandru Gagniuc 5c9e56c95b spci-pps: Add profile for Agilent N5767A DC source 2015-05-07 02:09:09 +02:00
Alexandru Gagniuc 6c0c9dd257 spci-pps/profiles: Support frequency control in Chroma 61604 2015-05-06 19:41:46 +02:00
Alexandru Gagniuc 4264f1c03b scpi-pps: Add infrastructure for controlling output frequency
This patch only adds the needed infrastructure to control output
frequency in the same manner as output voltage or current limit. This
does require a new field in the channel_spec struct, for the sake of
symmetry.
2015-05-06 19:41:46 +02:00
Alexandru Gagniuc a77585d4ae global: Add configuration key for output frequency target
This will be used to set up the output frequency of AC sources.
2015-05-06 19:41:46 +02:00
Alexandru Gagniuc b94dd07b08 global: Treat SR_CONF_OUTPUT_FREQUENCY as float instead of uint64_t
This makes 'output_frequency' symmetrical with 'output_current' and
'output_voltage'. On a more fundamental level, there's no reason why
frequency should be treated as a discrete quantity, other than
"es51919 used it this way".
2015-05-06 10:25:16 -07:00
Alexandru Gagniuc e8686e3ae3 asix-sigma: Avoid use of variable length arrays
This was only done once in sigma_write_register().
2015-05-01 13:42:25 +02:00
Alexandru Gagniuc 682fb08c88 python: classes.i: Declare strings with std::string
This makes it consistent with the rest of the string declarations in
this file, all of which use std::string.
2015-04-30 16:21:21 -07:00
Alexandru Gagniuc 4ee1e2f35f spci-pps: Add profile for Chroma 61604 AC Source
Only the capabilities which map directly to SCPI commands supported by
sigrok are implemented at this time. This is sufficient to control
the most often used functionality of this AC source
2015-04-29 22:59:56 +02:00
Alexandru Gagniuc 0c08023f50 scpi: Accept *IDN responses with more than four tokens
Some devices with more than one microcontroller report the firmware
version for each of them, giving us more than four tokens. When that
happens, sigrok aborts, even though it received a valid response.

This happens, for example with the Chroma 61604:
'Chroma ATE,61604,001060,1.25,1.34,1.20'
2015-04-29 22:59:56 +02:00
Aurelien Jacobs e35e1e7bab Compile with -std=c11 along with _POSIX_C_SOURCE=200112L.
With gcc 5.1 released and defaulting to std=gnu11, the code will be compiled
according to different standards depending on the compiler version so we
should better specify explicitly what standard we are targetting.
C11 is now quite mature, it is supported in the just release Debian stable
(gcc 4.9) and also in old-stable (gcc 4.7), so there should be no reason to
use anything more ancient.
We also should have no reason to need any non-standard GNU extension.
So using only C11 + POSIX sounds like the best option right now.
2015-04-28 22:07:03 +02:00
Aurelien Jacobs 76372c5a9c Define our own constant for PI.
M_PI is not defined in the C standard nor in POSIX, it is a
non-standard GNU extension.
2015-04-28 22:07:03 +02:00
Aurelien Jacobs ba464a1217 strcasecmp() is defined in strings.h. 2015-04-28 22:07:01 +02:00
Aurelien Jacobs 94b138a3c3 wav: Stricter check for valid chunk ID.
isascii() is a superset of isalpha() and isblank() so the current
code doesn't really make sense.
Moreover, isascii(x) is just a funky and non standard way to
write x < 128.
2015-04-28 22:05:47 +02:00
Martin Ling 2b51d48b38 C++: Change arguments of Input::send() from std::string to data+length. 2015-04-20 10:12:39 +01:00
Uwe Hermann 8d80146722 Lower libserialport requirement to 0.1.1. 2015-04-19 18:39:35 +02:00
Uwe Hermann 468665dfa7 Fix various warnings when building without libusb.
../src/backend.c: In function 'sr_init':
  ../src/backend.c:435:1: warning: label 'done' defined but not used [-Wunused-label]
   done:
   ^

  ../src/device.c: In function 'sr_dev_inst_connid_get':
  ../src/device.c:525:7: warning: unused variable 'connection_id' [-Wunused-variable]
    char connection_id[64];
         ^
  ../src/device.c:524:20: warning: unused variable 'b' [-Wunused-variable]
    int r, cnt, i, a, b;
                      ^
  ../src/device.c:524:17: warning: unused variable 'a' [-Wunused-variable]
    int r, cnt, i, a, b;
                   ^
  ../src/device.c:524:14: warning: unused variable 'i' [-Wunused-variable]
    int r, cnt, i, a, b;
                ^
  ../src/device.c:524:9: warning: unused variable 'cnt' [-Wunused-variable]
    int r, cnt, i, a, b;
           ^
  ../src/device.c:524:6: warning: unused variable 'r' [-Wunused-variable]
    int r, cnt, i, a, b;
        ^
  ../src/device.c:523:22: warning: unused variable 'drvc' [-Wunused-variable]
    struct drv_context *drvc;
                      ^
2015-04-17 17:45:07 +02:00