Commit Graph

4701 Commits

Author SHA1 Message Date
Uwe Hermann 741bcf503d sr_analog_to_float(): Fix a compiler warning (-Wshadow).
src/analog.c: In function ‘sr_analog_to_float’:
  src/analog.c:194:9: warning: declaration of ‘offset’ shadows a previous local [-Wshadow]
   float offset = analog->encoding->offset.p / (float)analog->encoding->offset.q;
         ^~~~~~
  src/analog.c:177:8: note: shadowed declaration is here
  float offset;
        ^~~~~~
2018-05-16 22:48:35 +02:00
Gerhard Sittig 53ea24610e demo: optionally accept frame limit spec at scan time
Allow developers to specify the (default) number of frames at compile
time (default to "off" as before). Accept the frame limit spec at scan()
time as well. This is useful when applications don't run config_set() at
runtime.

Tested with:
$ pulseview -d demo:logic_channels=0:analog_channels=1:limit_frames=4
2018-05-13 20:03:21 +02:00
Gerhard Sittig fb193945b6 demo: make frame generation (and maximum frame count) a runtime option
The previous implementation supported the generation of frames as a
compile time option. This change lets users adjust the feature at
runtime.

In the absence of a frame count limit no frame begin/end markers get
sent (the default behaviour of the previous implementation). When a
frame count limit is specified, the respective number of frames gets
sent and acquisition stops.

The fixed amount of 1000 samples per frame is an arbitrary choice. This
compile time option is easily adjusted in the source code.
2018-05-13 20:03:21 +02:00
Gerhard Sittig 0373343046 demo: introduce graycode generator mode
Introduce support for the "graycode" logic pattern. Generate up to
64 bits of graycode output (all logic lines, no repetition, not limited
by the generator's internal pattern buffer). The implementation was
tested with 16 channels.
2018-05-13 19:45:46 +02:00
Gerhard Sittig 015f09702a demo: add convenient bit mask for "all logic channels"
Keep a context variable around with a bit mask for all logic channels.
This is convenient in setup and generation routines, to avoid garbage
in unassigned bit positions of session feed packets.
2018-05-13 19:40:00 +02:00
Gerhard Sittig 817e759ddc demo: data type nits in the device context (enum, unsigned int)
Move the declaration of codes for pattern types before the declaration
of the context container such that the latter can reference the former.
Add 'int' to an unsigned variable that omitted the base type.
2018-05-13 19:27:51 +02:00
Gerhard Sittig cdb134eb19 input/trace32_ad: silence format errors during input format match
When auto-detection tries to find the input module that can handle a
file, unexpected input format should be considered non-fatal. Only emit
error messages when process_header() got invoked from process_buffer()
after initialization. Emit debug messages in early stages where no input
module context exists yet.
2018-04-28 23:42:42 +02:00
Uwe Hermann 55bcd7ad45 dreamsourcelab-dslogic: Properly set initial voltage threshold.
The initial voltage threshold in dev_open() was being set to a
default value in the devc->cur_threshold variable but not actually set
in the device itself.

Patch by Jörg Alpers <jalpers@gmx.net>, thanks a lot!
2018-04-28 23:39:59 +02:00
Uwe Hermann 8a14fc0828 dmm/ms8250d: Fix two log messages. 2018-04-27 00:07:21 +02:00
Mandl 67070942cc Add support for the MASTECH MS8250D multimeter 2018-04-27 00:07:21 +02:00
Uwe Hermann 2bd5d17c70 hantek-4032l: Emit FPGA version log message. 2018-04-24 21:09:42 +02:00
Uwe Hermann eca9772971 soft-trigger: Fix an issue causing triggers to not work. 2018-04-24 16:56:07 +02:00
Uwe Hermann ce97fc3f6a rigol-ds: Fix an issue causing only one channel to be acquired.
This fixes bug #1018.
2018-04-22 18:36:12 +02:00
Uwe Hermann 350501d0c3 rigol-ds: Make two log messages more specific.
Slightly modified version of a suggested change by Aleksander Alsekseev.
2018-04-22 16:49:33 +02:00
Andrej Valek a5b9880eb2 hantek-4032l: Add option to abort acquisition.
Signed-off-by: Andrej Valek <andy@skyrain.eu>
2018-04-22 11:16:34 +02:00
Andrej Valek 74c4c1747f hantek-4032l: Fix mismatch in magic number.
- fix LIBUSB_TIMEOUT errors
- fix same data receiving
- send reset vendor request before new data getting
- decrease USB polling timeout

This fixes bug #1190.

Signed-off-by: Andrej Valek <andy@skyrain.eu>
2018-04-22 11:15:05 +02:00
Andrej Valek e80e1858ef hantek-4032l: Fix structure packing.
- use pragma to handle different behavior between gcc and minGW bit-field packing
- bit-field integer variables needs to be align to 2-byte boundary
Compiler does not produce an error when accessing into non-__packed pointer.
However, the field might not be properly aligned for this type.
More information could be found on:
 - https://sourceforge.net/p/mingw-w64/bugs/275/
 - http://www.keil.com/support/man/docs/ARMCC/armcc_chr1359124990875.htm

Signed-off-by: Andrej Valek <andy@skyrain.eu>
2018-04-22 11:11:06 +02:00
Andrej Valek 972001561b hantek-4032l: Fix typo from device porting to new lib version.
Signed-off-by: Andrej Valek <andy@skyrain.eu>
2018-04-22 11:11:06 +02:00
Uwe Hermann 2c267f6819 log: Move log level check so that it affects all handlers.
Before this change, the loglevel check would only be performed for the
default log handler in libsigrok, but not for other handlers set
via sr_log_callback_set().

This fixes bug #698.
2018-04-22 00:23:10 +02:00
Uwe Hermann 7c59d8f310 output/csv: Make the label values option a list.
This allows UIs to display a drop-down with all possible choices,
instead of forcing the user to look up / remember all of them.
2018-04-21 23:30:44 +02:00
Uwe Hermann 31c41782e4 input/csv: Make the data format option a list.
This allows UIs to display a drop-down with all possible choices,
instead of forcing the user to look up / remember all of them.
2018-04-21 23:28:58 +02:00
Uwe Hermann d52107a159 soft-trigger: Use g_try_malloc() for potentially large allocation.
This fixes bug #1000.
2018-04-21 23:27:00 +02:00
Uwe Hermann 567fe53822 session_driver: Quickfix to prevent looped analog data reads.
A local buffer was too small, snprintf() was used to write the
name of the analog-1-1-xxx ZIP archive names in that buffer.

Due to the limited size, only 3 characters were usable for the last
number component, i.e. the code would loop around from analog-1-1-999
to analog-1-1-100 (instead of analog-1-1-1000).

As a quickfix, increase the buffer size by a large margin, a nicer
fix should be used later on.
2018-04-19 23:29:22 +02:00
Uwe Hermann 2003be8cec input/null: Add a null module that discards all data.
This is useful for testing purposes.
2018-04-19 22:15:54 +02:00
Uwe Hermann 1af7497d67 output/null: Add a null module that discards all data.
This is useful for testing purposes.
2018-04-19 20:10:50 +02:00
Uwe Hermann b20eb52055 input/output: Slightly improved module descriptions. 2018-04-19 18:21:07 +02:00
Uwe Hermann 9a4fd01af8 input modules: Increase chunk size to 4MB for all modules.
This reduces overhead and can slightly increase performance, depending
on the module.
2018-04-19 17:39:15 +02:00
Uwe Hermann 8bc2fa6d82 input modules: Name chunk size #defines CHUNK_SIZE consistently. 2018-04-19 17:38:05 +02:00
Uwe Hermann 1fb31414f2 input/trace32_ad: Drop unused #define. 2018-04-19 17:37:15 +02:00
Uwe Hermann 2cff7a2ba7 input/wav: Put internal buffer on the heap instead of the stack.
Increasing the buffer/chunk size could cause issues when trying to put
large arrays on the stack.
2018-04-19 17:37:15 +02:00
Uwe Hermann a33e4be826 input/binary: Increase chunk size from 4KB to 4MB.
This can slightly increase performance when loading larger files.
2018-04-14 22:23:02 +02:00
Uwe Hermann 408b6ab42b input/binary: Only calculate unitsize once. 2018-04-14 19:46:43 +02:00
Uwe Hermann 867293a101 input modules: Improve option names and descriptions.
These should be slightly more useful and contain more information
(should also work reasonably well for 'sigrok-cli --show' and as
tooltips in UIs).
2018-04-14 18:47:49 +02:00
Uwe Hermann d4b3f44fa7 zketech-ebd-usb: Drop unneeded log message.
The number of bytes sent is already logged by the libsigrok serial code.
2018-04-08 20:56:34 +02:00
Uwe Hermann b4bf6b3b4f configure.ac: zketech-ebd-usb driver needs libserialport. 2018-04-08 19:59:25 +02:00
Uwe Hermann 330a32b240 zketech-ebd-usb: Shorten function name prefix for better readability. 2018-04-08 19:59:25 +02:00
Uwe Hermann cb8a0efc5c zketech-ebd-usb: Make a few functions static. 2018-04-08 19:59:25 +02:00
Uwe Hermann ec4806dcf5 zketech-ebd-usb: Add some underscores to #defines. 2018-04-08 19:59:25 +02:00
Sven Bursch-Osewold 9890fb1f08 zketech-ebd-usb: First version of the driver. 2018-04-08 19:59:25 +02:00
Sven Bursch-Osewold c527132aec zketech-ebd-usb: Initial driver skeleton. 2018-04-08 19:59:25 +02:00
Uwe Hermann 23d68466f8 usbtmc: Silence some overly verbose log messages.
These trigger quite often with unrelated devices and confuse people.

  scpi_usbtmc: Failed to get configuration descriptor: LIBUSB_ERROR_NOT_FOUND, ignoring device.
2018-04-08 19:49:41 +02:00
Uwe Hermann 66d2cc3a27 rdtech-dps: User ternary operator. 2018-03-29 15:45:52 +02:00
James Churchill 69b0558395 rdtech-dps: New driver for RDTech DPS/DPH series PSUs. 2018-03-29 15:41:30 +02:00
James Churchill 0549416e36 rdtech-dps: Initial driver skeleton. 2018-03-26 15:41:01 +10:00
James Churchill 7b50a9b869 modbus: Return explicit SR_ERR values as required by modbus.c
The Modbus RTU implementation was inappropriately returning lengths
from the serial functions when the calling functions expect only an
sr_error_code value.
2018-03-26 15:41:01 +10:00
James Churchill d4e0701771 modbus: Increase modbus reply timeout to 500ms.
Needed by rdtech-dps driver, 100ms is too short.
2018-03-26 15:41:01 +10:00
Soeren Apel 366ccb8ab7 resource.c: Fix firmware loading bug (#1140) 2018-03-20 16:13:46 +01:00
Uwe Hermann 410883baf6 backend: Emit firmware search paths in a log message. 2018-03-18 18:26:57 +01:00
Soeren Apel addb7340dd Introduce sr_resourcepaths_get()
This provides an interface to fix #1128.
2018-03-18 18:25:36 +01:00
Axel Hinrichs e843992dda korad-kaxxxxp: Korad OEM: RND KA3005P 2018-03-12 16:34:43 +01:00