]> sigrok.org Git - libsigrok.git/log
libsigrok.git
6 years agoipdbg-la: Fix two compiler warnings on Windows.
Uwe Hermann [Sat, 1 Sep 2018 19:02:35 +0000 (21:02 +0200)]
ipdbg-la: Fix two compiler warnings on Windows.

This is happening because the send() and recv() functions
have different prototypes on POSIX and Windows. Using the casts
is required on Windows and doesn't hurt on POSIX systems.

  [...]/protocol.c: In function 'tcp_send':
  [...]/protocol.c:161:26: warning: pointer targets in passing argument 2 of 'send' differ in signedness [-Wpointer-sign]
    out = send(tcp->socket, buf, len, 0);
                            ^
  In file included from [...]/protocol.c:24:0:
  [...]/include/winsock2.h:997:34: note: expected 'const char *' but argument is of type 'const uint8_t * {aka const unsigned char *}'
     WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
                                    ^
  [...]/protocol.c: In function 'ipdbg_la_tcp_receive':
  [...]/protocol.c:201:32: warning: pointer targets in passing argument 2 of 'recv' differ in signedness [-Wpointer-sign]
      int len = recv(tcp->socket, buf, 1, 0);
                                  ^
  In file included from [...]/protocol.c:24:0:
  [...]/include/winsock2.h:992:34: note: expected 'char *' but argument is of type 'uint8_t * {aka unsigned char *}'
     WINSOCK_API_LINKAGE int WSAAPI recv(SOCKET s,char *buf,int len,int flags);
                                    ^

6 years agoipdbg-la: Fix data_available() implementation on Windows.
Uwe Hermann [Sat, 1 Sep 2018 19:01:43 +0000 (21:01 +0200)]
ipdbg-la: Fix data_available() implementation on Windows.

  [...]/protocol.c: In function 'data_available':
  [...]/protocol.c:73:38: error: 'bytes_available' undeclared (first use in this function)
    ioctlsocket(tcp->socket, FIONREAD, &bytes_available);
                                        ^
  [...]/protocol.c:73:38: note: each undeclared identifier is reported only once for each function it appears in
  [...]/protocol.c:84:1: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^

6 years agoipdbg-la: Fix a build issue on Windows.
Uwe Hermann [Sat, 1 Sep 2018 19:00:31 +0000 (21:00 +0200)]
ipdbg-la: Fix a build issue on Windows.

  [...]/protocol.c:41:23: fatal error: sys/ioctl.h: No such file or directory

6 years agofx2lafw: silence error message in query for channel group's device options
Gerhard Sittig [Tue, 28 Aug 2018 16:18:37 +0000 (18:18 +0200)]
fx2lafw: silence error message in query for channel group's device options

The fx2lafw(4) driver supports mere logic analyzers as well as mixed
signal devices, but does not support channel group specific device
options. Avoid an error message when channel group device options get
queried, the condition is perfectly legal and non-fatal.

How to reproduce:
  $ pulseview -d fx2lafw
  $ sigrok-cli -d fx2lafw -g Logic --show

This fixes bug #1267.

6 years agosaleae and other FX2: show firmware name when loading fails
Gerhard Sittig [Sat, 18 Aug 2018 13:31:09 +0000 (15:31 +0200)]
saleae and other FX2: show firmware name when loading fails

The "firmware load failed" message would be even more helpful if users
could learn which firmware file failed to load. Add those filenames to
various FX2-based drivers.

This addresses bug #1262.

6 years agoAdd a new sr_log_callback_get() API call.
Uwe Hermann [Sun, 1 Jul 2018 14:46:47 +0000 (16:46 +0200)]
Add a new sr_log_callback_get() API call.

6 years agoipdbg-la: scan(): Use g_strdup_printf().
Uwe Hermann [Thu, 30 Aug 2018 00:02:51 +0000 (02:02 +0200)]
ipdbg-la: scan(): Use g_strdup_printf().

6 years agoipdbg-la: Make some functions static.
Uwe Hermann [Wed, 29 Aug 2018 23:46:20 +0000 (01:46 +0200)]
ipdbg-la: Make some functions static.

6 years agoipdbg-la: Avoid CamelCaps and ALLCAPS variable names.
Uwe Hermann [Wed, 29 Aug 2018 23:35:48 +0000 (01:35 +0200)]
ipdbg-la: Avoid CamelCaps and ALLCAPS variable names.

6 years agoipdbg-la: Drop some unneeded casts.
Uwe Hermann [Wed, 29 Aug 2018 23:11:03 +0000 (01:11 +0200)]
ipdbg-la: Drop some unneeded casts.

6 years agoipdbg-la: data_available(): Return gboolean.
Uwe Hermann [Wed, 29 Aug 2018 23:02:32 +0000 (01:02 +0200)]
ipdbg-la: data_available(): Return gboolean.

6 years agoipdbg-la: Use std_init() and std_dev_list().
Uwe Hermann [Wed, 29 Aug 2018 22:58:57 +0000 (00:58 +0200)]
ipdbg-la: Use std_init() and std_dev_list().

6 years agoipdbg-la: Consistently use g_strerror().
Uwe Hermann [Wed, 29 Aug 2018 22:53:18 +0000 (00:53 +0200)]
ipdbg-la: Consistently use g_strerror().

6 years agoipdbg-la: Drop unneeded g_malloc0() checks for small allocations.
Uwe Hermann [Wed, 29 Aug 2018 22:52:19 +0000 (00:52 +0200)]
ipdbg-la: Drop unneeded g_malloc0() checks for small allocations.

6 years agoipdbg-la: Drop unneeded sdi->status handling.
Uwe Hermann [Wed, 29 Aug 2018 22:50:35 +0000 (00:50 +0200)]
ipdbg-la: Drop unneeded sdi->status handling.

This is already done by the backend wrapper functions.

6 years agoipdbg-la: Simplify config_get/_set/_list.
Uwe Hermann [Wed, 29 Aug 2018 22:47:03 +0000 (00:47 +0200)]
ipdbg-la: Simplify config_get/_set/_list.

6 years agoipdbg-la: Fix devopts[] contents.
Uwe Hermann [Wed, 29 Aug 2018 22:39:40 +0000 (00:39 +0200)]
ipdbg-la: Fix devopts[] contents.

6 years agoipdbg-la: Drop various unneeded name prefixes.
Uwe Hermann [Wed, 29 Aug 2018 22:12:12 +0000 (00:12 +0200)]
ipdbg-la: Drop various unneeded name prefixes.

6 years agoipdbg-la: Fix incorrect copyright headers.
Uwe Hermann [Wed, 29 Aug 2018 22:13:26 +0000 (00:13 +0200)]
ipdbg-la: Fix incorrect copyright headers.

As per Daniel Anselmi <redacted> in an email conversation, the
code was actually written by Eva Kissling <redacted>
(as indicated in the commit logs as well). Fix the headers accordingly.

6 years agoipdbg-la: Consistently use the same naming everywhere.
Uwe Hermann [Wed, 29 Aug 2018 22:02:16 +0000 (00:02 +0200)]
ipdbg-la: Consistently use the same naming everywhere.

Use "ipdbg-la" everywhere to refer to the driver, including
in function name prefixes etc. There's no need to encode
website details (.org) into the driver/function name(s).

6 years agoipdbg-la: Allow rx to time out and handle invalid data properly
Soeren Apel [Tue, 21 Aug 2018 09:12:12 +0000 (11:12 +0200)]
ipdbg-la: Allow rx to time out and handle invalid data properly

This is required for when we connect to invalid devices, e.g.
port 4243 of the IPDBG host instead of 4242.

6 years agoipdbg-la: Remove SR_CONF_SERIALCOMM
Soeren Apel [Mon, 20 Aug 2018 21:26:46 +0000 (23:26 +0200)]
ipdbg-la: Remove SR_CONF_SERIALCOMM

6 years agoipdbg-la: Adjust to sigrok indentation style
Soeren Apel [Mon, 20 Aug 2018 21:16:14 +0000 (23:16 +0200)]
ipdbg-la: Adjust to sigrok indentation style

6 years agoipdbg-la: More style fixes
Soeren Apel [Mon, 20 Aug 2018 20:51:32 +0000 (22:51 +0200)]
ipdbg-la: More style fixes

6 years agoipdbg-la: Style fixes
Soeren Apel [Sun, 12 Aug 2018 08:12:06 +0000 (10:12 +0200)]
ipdbg-la: Style fixes

6 years agoipdbg-la: stop-command
Eva Kissling [Mon, 2 Oct 2017 15:17:09 +0000 (17:17 +0200)]
ipdbg-la: stop-command

6 years agoipdbg-la: stop-function pulseview
Eva Kissling [Thu, 28 Sep 2017 11:32:32 +0000 (13:32 +0200)]
ipdbg-la: stop-function pulseview

6 years agoipdbg-la: add edge trigger option
Eva Kissling [Mon, 25 Sep 2017 19:32:13 +0000 (21:32 +0200)]
ipdbg-la: add edge trigger option

6 years agoipdbg-la: revers order of trigger settings
Eva Kissling [Wed, 13 Sep 2017 17:40:31 +0000 (19:40 +0200)]
ipdbg-la: revers order of trigger settings

6 years agoipdbg-la: return correct samples limit
Eva Kissling [Mon, 11 Sep 2017 15:30:53 +0000 (17:30 +0200)]
ipdbg-la: return correct samples limit

6 years agoipdbg-la: add "loggs"
Eva Kissling [Fri, 8 Sep 2017 14:46:32 +0000 (16:46 +0200)]
ipdbg-la: add "loggs"

6 years agoipdbg-la: get rid of crash on shutdown
Eva Kissling [Thu, 24 Aug 2017 16:37:45 +0000 (18:37 +0200)]
ipdbg-la: get rid of crash on shutdown

6 years agoipdbg-la: reduce warnings (added explicit casts)
Eva Kissling [Thu, 25 May 2017 22:25:05 +0000 (00:25 +0200)]
ipdbg-la: reduce warnings (added explicit casts)

6 years agoipdbg-la: Add changes for IPDBG project
Eva Kissling [Tue, 16 May 2017 20:13:53 +0000 (22:13 +0200)]
ipdbg-la: Add changes for IPDBG project

6 years agosr_buildinfo_libs_get(): Also support LIBUSBX_API_VERSION.
Uwe Hermann [Sun, 22 Jul 2018 15:57:34 +0000 (17:57 +0200)]
sr_buildinfo_libs_get(): Also support LIBUSBX_API_VERSION.

This fixes a build issue on some distros / libusb versions.

6 years agoFix multiple C++ bindings warnings with gcc 8.
Uwe Hermann [Sun, 22 Jul 2018 15:07:26 +0000 (17:07 +0200)]
Fix multiple C++ bindings warnings with gcc 8.

  bindings/cxx/classes.cpp: In function ‘int sigrok::call_log_callback(void*, int, const char*, __va_list_tag*)’:
  bindings/cxx/classes.cpp:242:17: warning: catching polymorphic type ‘class sigrok::Error’ by value [-Wcatch-value=]
    } catch (Error e) {
                   ^
  In file included from bindings/cxx/classes.cpp:1667:
  bindings/cxx/enums.cpp: In static member function ‘static Glib::VariantBase sigrok::ConfigKey::parse_string(std::__cxx11::string, sr_datatype)’:
  bindings/cxx/enums.cpp:789:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
      } catch (invalid_argument) {
               ^~~~~~~~~~~~~~~~
  bindings/cxx/enums.cpp:804:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
      } catch (invalid_argument) {
               ^~~~~~~~~~~~~~~~

6 years agoinput/wav: Fix potential buffer overflow (and compiler warning).
Uwe Hermann [Sun, 22 Jul 2018 14:59:38 +0000 (16:59 +0200)]
input/wav: Fix potential buffer overflow (and compiler warning).

With gcc 8 this yielded:

  src/input/wav.c: In function ‘receive’:
  src/input/wav.c:345:51: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
                                                     ^~
  src/input/wav.c:345:48: note: directive argument in the range [1, 2147483647]
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
                                                  ^~~~~~
  src/input/wav.c:345:5: note: ‘snprintf’ output between 4 and 13 bytes into a destination of size 8
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agostrutil.c: Use gboolean in favor of bool for consistency.
Uwe Hermann [Sun, 22 Jul 2018 14:37:58 +0000 (16:37 +0200)]
strutil.c: Use gboolean in favor of bool for consistency.

6 years agotests: add (negative) "." test case for rational conversion
Gerhard Sittig [Thu, 19 Jul 2018 19:45:10 +0000 (21:45 +0200)]
tests: add (negative) "." test case for rational conversion

A naive implementation of the parse rational conversion helper could
have accepted invalid input. Check for the expected conversion failure.

6 years agotests: add more cases for text to rational number conversion
Gerhard Sittig [Mon, 16 Jul 2018 19:19:36 +0000 (21:19 +0200)]
tests: add more cases for text to rational number conversion

Test the ".1" and "1." cases which are assumed to be problematic on
MacOS (or may not have been supported before a recent update). Add more
tests with leading signs as well as whitespace instead of a sign.

6 years agostrutil: insist in some mantissa for parse rational
Gerhard Sittig [Thu, 19 Jul 2018 20:12:15 +0000 (22:12 +0200)]
strutil: insist in some mantissa for parse rational

The previous implementation accepted either empty integer or empty
fractional parts of a floating point number, but also when both parts
were missing ("." input). Insist in at least one of the parts to be
present.

6 years agostrutil: accept leading whitespace in parse rational
Gerhard Sittig [Thu, 19 Jul 2018 19:10:15 +0000 (21:10 +0200)]
strutil: accept leading whitespace in parse rational

Programmatic output of floating point numbers might choose to print
spaces instead of an explicit '+' sign, to align the output with the
result of formatting negative numbers yet achieve a screen appearance
similar to what humans would have written. Skip leading whitespace
before insisting in seeing either signs or digits or decimals.

6 years agostrutil: handle empty fractional in parse rational
Gerhard Sittig [Thu, 19 Jul 2018 19:05:54 +0000 (21:05 +0200)]
strutil: handle empty fractional in parse rational

Accept numbers like "123." where the period (dot) is present yet the
fractional part is empty. Adding a period but no additional digits is a
popular method of turning an otherwise integer literal into a float.
Compilers and strtod() routines accept this notation, too, so we have to
expect seeing such input.

6 years agostrutil: cosmetics, fixup minor style nits
Gerhard Sittig [Thu, 19 Jul 2018 18:59:37 +0000 (20:59 +0200)]
strutil: cosmetics, fixup minor style nits

6 years agotests: echo text input when rational conversion fails
Gerhard Sittig [Mon, 16 Jul 2018 19:00:06 +0000 (21:00 +0200)]
tests: echo text input when rational conversion fails

The previous implementation only echoed the p/q conversion results _if_
the return code signalled success but the result was unexpected. Although
the errno value for failed conversion attempts (non-zero return codes)
is not too helpful, seeing which text input failed the test is desirable.

6 years agoinput/vcd: abort VCD import when timestamp counts backwards
Gerhard Sittig [Sat, 21 Jul 2018 20:30:05 +0000 (22:30 +0200)]
input/vcd: abort VCD import when timestamp counts backwards

The VCD specification requests that timestamps will strictly increase as
one advances through the file. Add another check where the previous
implementation resulted in a tight loop and made the application stall.
Do print an error message and abort file processing in that case.

This fixes bug #1250.

6 years agosr_buildinfo_libs_get(): Show LIBUSB_API_VERSION.
Uwe Hermann [Thu, 19 Jul 2018 21:56:33 +0000 (23:56 +0200)]
sr_buildinfo_libs_get(): Show LIBUSB_API_VERSION.

6 years agoconfigure.ac: Emit a warning if the C++ bindings are not being built.
Uwe Hermann [Tue, 17 Jul 2018 17:43:54 +0000 (19:43 +0200)]
configure.ac: Emit a warning if the C++ bindings are not being built.

6 years agostrutil: Fix unit test failure (bug #1093).
Uwe Hermann [Tue, 17 Jul 2018 17:06:05 +0000 (19:06 +0200)]
strutil: Fix unit test failure (bug #1093).

Patch by Wojciech Lazarski, thanks a lot!

6 years agooutput: simplify trigger marker position calculation (readability)
Gerhard Sittig [Sun, 15 Jul 2018 18:11:58 +0000 (20:11 +0200)]
output: simplify trigger marker position calculation (readability)

This amends commit 67b345b981a5 which fixed the calculation of the
trigger marker's position. Improve readability of the formulae and
adjust comments.

6 years agooutput: fixup trigger marker position in ascii/bits/hex output modules
Gerhard Sittig [Wed, 27 Jun 2018 21:57:45 +0000 (23:57 +0200)]
output: fixup trigger marker position in ascii/bits/hex output modules

Adjust the calculation of the '^' marker's position in T: lines of the
-O ascii/bits/hex output modules such that it matches the sample data
lines' layout. Add comments which discuss the motivation of the marker
position's calculation, which differs among each of those modules.

Strictly speaking -O bits was already correct. But I chose to adjust and
comment the logic such that multiple output modules follow a common
pattern. If performance is an issue, the bits.c change might be worth
reverting.

This commit fixes bug #1238.

6 years agostd: Improve prototypes of some functions.
Uwe Hermann [Sun, 27 May 2018 19:14:37 +0000 (21:14 +0200)]
std: Improve prototypes of some functions.

6 years agorigol-ds: Add initial Agilent MSO7034A support.
Uwe Hermann [Fri, 22 Jun 2018 20:37:10 +0000 (22:37 +0200)]
rigol-ds: Add initial Agilent MSO7034A support.

Digital channels (and various other features) are not yet supported.

6 years agorigol-ds: Improve a log message.
Uwe Hermann [Thu, 31 May 2018 17:17:52 +0000 (19:17 +0200)]
rigol-ds: Improve a log message.

6 years agosiglent-sds: Drop currently unused switch/case.
Uwe Hermann [Wed, 21 Feb 2018 21:57:59 +0000 (22:57 +0100)]
siglent-sds: Drop currently unused switch/case.

6 years agosiglent_sds_channel_start(): Use ternary operator to shorten code.
Uwe Hermann [Wed, 21 Feb 2018 20:36:58 +0000 (21:36 +0100)]
siglent_sds_channel_start(): Use ternary operator to shorten code.

6 years agorigol-ds: Add missing "return SR_ERR".
Uwe Hermann [Fri, 22 Jun 2018 08:53:03 +0000 (10:53 +0200)]
rigol-ds: Add missing "return SR_ERR".

6 years agosiglent-sds: Fixed samplerate and memory depth calculation
marchelh [Mon, 5 Mar 2018 16:10:56 +0000 (17:10 +0100)]
siglent-sds: Fixed samplerate and memory depth calculation

6 years agosiglent-sds: Fix, USB connection problem partially solved, bug #1130
marchelh [Sun, 4 Mar 2018 12:27:19 +0000 (13:27 +0100)]
siglent-sds: Fix, USB connection problem partially solved, bug #1130

6 years agoudev: Add rule for Rigol DS4000 series devices.
Uwe Hermann [Thu, 21 Jun 2018 23:13:22 +0000 (01:13 +0200)]
udev: Add rule for Rigol DS4000 series devices.

6 years agorigol-ds: Initial patch for Rigol DS4000 support
Valentin Ochs [Thu, 24 May 2018 20:30:05 +0000 (22:30 +0200)]
rigol-ds: Initial patch for Rigol DS4000 support

This fixes bug #1208.

6 years agorigol-ds: Rename the CHANINFO macro and comment it
Valentin Ochs [Thu, 24 May 2018 20:59:52 +0000 (22:59 +0200)]
rigol-ds: Rename the CHANINFO macro and comment it

6 years agorigol-ds: Store trigger sources and their number for each model
Valentin Ochs [Thu, 24 May 2018 20:55:18 +0000 (22:55 +0200)]
rigol-ds: Store trigger sources and their number for each model

Store trigger sources and their number for each model when it is probed
and use that.

This fixes bug #299.

6 years agotests: Expand test_analog_unit_to_string unit test.
Uwe Hermann [Tue, 19 Jun 2018 05:22:12 +0000 (07:22 +0200)]
tests: Expand test_analog_unit_to_string unit test.

6 years agotests: Fix test_analog_unit_to_string unit test.
Uwe Hermann [Tue, 19 Jun 2018 05:03:29 +0000 (07:03 +0200)]
tests: Fix test_analog_unit_to_string unit test.

The loop body was never executed.

6 years agoserial-dmm: Fix Voltcraft VC-96 sorting.
Uwe Hermann [Mon, 18 Jun 2018 14:16:27 +0000 (16:16 +0200)]
serial-dmm: Fix Voltcraft VC-96 sorting.

6 years agodmm/vc96: Drop some obsolete debug output.
Uwe Hermann [Mon, 18 Jun 2018 14:07:18 +0000 (16:07 +0200)]
dmm/vc96: Drop some obsolete debug output.

6 years agoAdd support for the Voltcraft VC-96 DMM.
Matthias Schulz [Sun, 10 Jun 2018 18:25:32 +0000 (20:25 +0200)]
Add support for the Voltcraft VC-96 DMM.

6 years agodtm0660: Do not apply the exponent twice on the value
Adrian Stratulat [Fri, 15 Jun 2018 13:39:15 +0000 (16:39 +0300)]
dtm0660: Do not apply the exponent twice on the value

This fixes bug #1236.

6 years agoFix: Bug #1188 DSLogic triggering
Joerg Alpers [Sun, 3 Jun 2018 10:23:16 +0000 (12:23 +0200)]
Fix: Bug #1188 DSLogic triggering

6 years agofluke-45: Add initial driver implementation.
JohnCh [Sat, 9 Sep 2017 16:31:15 +0000 (17:31 +0100)]
fluke-45: Add initial driver implementation.

6 years agofluke-45: Initial driver skeleton.
JohnCh [Sat, 9 Sep 2017 16:31:15 +0000 (17:31 +0100)]
fluke-45: Initial driver skeleton.

6 years agogwinstek-gpd: Fix sr_dev_driver struct.
Uwe Hermann [Thu, 14 Jun 2018 22:18:22 +0000 (00:18 +0200)]
gwinstek-gpd: Fix sr_dev_driver struct.

6 years agogwinstek-gpd: Avoid some unnecessary assignments.
Uwe Hermann [Thu, 14 Jun 2018 20:20:57 +0000 (22:20 +0200)]
gwinstek-gpd: Avoid some unnecessary assignments.

6 years agogwinstek-gpd: Drop some unneeded debug logs.
Uwe Hermann [Thu, 14 Jun 2018 20:05:03 +0000 (22:05 +0200)]
gwinstek-gpd: Drop some unneeded debug logs.

6 years agogwinstek-gpd: Initial implementation.
Bastian Schmitz [Fri, 2 Feb 2018 16:45:32 +0000 (17:45 +0100)]
gwinstek-gpd: Initial implementation.

6 years agowav: Don't assume CHUNK_SIZE >= total_samples
Soeren Apel [Tue, 5 Jun 2018 14:53:59 +0000 (16:53 +0200)]
wav: Don't assume CHUNK_SIZE >= total_samples

6 years agohantek-4032l: Minor cosmetic fix.
Uwe Hermann [Tue, 5 Jun 2018 22:01:04 +0000 (00:01 +0200)]
hantek-4032l: Minor cosmetic fix.

6 years agohantek-4032l: Rename 'devc->buffer' to 'devc->buf'.
Uwe Hermann [Tue, 5 Jun 2018 21:58:57 +0000 (23:58 +0200)]
hantek-4032l: Rename 'devc->buffer' to 'devc->buf'.

This is shorter and also avoids confusion with transfer->buffer.

6 years agohantek-4032l: Rename number_samples to num_samples.
Uwe Hermann [Tue, 5 Jun 2018 21:56:30 +0000 (23:56 +0200)]
hantek-4032l: Rename number_samples to num_samples.

6 years agohantek-4032l: Use MIN() where possible.
Uwe Hermann [Tue, 5 Jun 2018 21:55:23 +0000 (23:55 +0200)]
hantek-4032l: Use MIN() where possible.

6 years agohantek-4032l: Simplify some config_get/_set parts.
Uwe Hermann [Tue, 5 Jun 2018 21:43:23 +0000 (23:43 +0200)]
hantek-4032l: Simplify some config_get/_set parts.

Also, drop some unneeded checks.

6 years agohantek-4032l: config_set(): Simplify SR_CONF_CAPTURE_RATIO case.
Uwe Hermann [Tue, 5 Jun 2018 21:14:51 +0000 (23:14 +0200)]
hantek-4032l: config_set(): Simplify SR_CONF_CAPTURE_RATIO case.

The sr_config_set() wrapper already checks the value.

6 years agohantek-4032l: Drop some unneeded malloc checks.
Uwe Hermann [Tue, 5 Jun 2018 21:02:58 +0000 (23:02 +0200)]
hantek-4032l: Drop some unneeded malloc checks.

As per guidelines in HACKING.

6 years agohantek-4032l: Reduce indentation level a bit.
Uwe Hermann [Tue, 5 Jun 2018 20:59:29 +0000 (22:59 +0200)]
hantek-4032l: Reduce indentation level a bit.

6 years agozketech-ebd-usb: Fix a compiler warning.
Uwe Hermann [Tue, 5 Jun 2018 17:40:46 +0000 (19:40 +0200)]
zketech-ebd-usb: Fix a compiler warning.

6 years agohantek-4032l: Add support for external clocks.
Andrej Valek [Mon, 28 May 2018 17:51:29 +0000 (19:51 +0200)]
hantek-4032l: Add support for external clocks.

These options are NOT available for FPGA version 0.

- add option to select edge type

Signed-off-by: Andrej Valek <redacted>
6 years agoAdd SR_CONF_EXTERNAL_CLOCK_SOURCE key.
Andrej Valek [Mon, 28 May 2018 17:51:29 +0000 (19:51 +0200)]
Add SR_CONF_EXTERNAL_CLOCK_SOURCE key.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Separate threshold channels.
Andrej Valek [Tue, 22 May 2018 20:33:12 +0000 (22:33 +0200)]
hantek-4032l: Separate threshold channels.

Split global threshold into channels A and B.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Set new pwm threshold handling.
Andrej Valek [Tue, 22 May 2018 20:33:12 +0000 (22:33 +0200)]
hantek-4032l: Set new pwm threshold handling.

Calculate threshold values from <-6.0;6.0> range.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Implement trigger handling.
Andrej Valek [Mon, 30 Apr 2018 18:00:11 +0000 (20:00 +0200)]
hantek-4032l: Implement trigger handling.

Send trigger position to upper layer.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Set maximum samples size to 64MB.
Andrej Valek [Mon, 30 Apr 2018 13:29:17 +0000 (15:29 +0200)]
hantek-4032l: Set maximum samples size to 64MB.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Increase speed of data getting.
Andrej Valek [Sun, 29 Apr 2018 21:20:51 +0000 (23:20 +0200)]
hantek-4032l: Increase speed of data getting.

- add support for multiple transfers.
 - set nummber of samples to 1 for FPGA FW version 0
- increase size of data transfer buffer to 2kB.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Separate USB receive callbacks.
Andrej Valek [Sun, 29 Apr 2018 20:38:47 +0000 (22:38 +0200)]
hantek-4032l: Separate USB receive callbacks.

Callback for data transfer is separated from status. This change will be
used for better data transfer sending/receiving. Cast signal, that trigger
has been captured was moved into state: H4032L_STATUS_FIRST_TRANSFER.

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Get FGPA version.
Andrej Valek [Sun, 29 Apr 2018 20:15:12 +0000 (22:15 +0200)]
hantek-4032l: Get FGPA version.

- get FPGA version in dev_open
 - enable some features only for newer FPGA
- decrease printing number of message of FPGA version

Signed-off-by: Andrej Valek <redacted>
6 years agohantek-4032l: Unify style.
Andrej Valek [Sun, 29 Apr 2018 20:07:09 +0000 (22:07 +0200)]
hantek-4032l: Unify style.

Signed-off-by: Andrej Valek <redacted>
6 years agoFix #1167 by not creating sigrok channels twice
Soeren Apel [Sun, 3 Jun 2018 14:50:27 +0000 (16:50 +0200)]
Fix #1167 by not creating sigrok channels twice

Also fixes a similar bug in the analog_raw input module that prevented
it from resetting properly - it freed its resources by calling cleanup().

6 years agoinput/logicport: remove obsolete reset/cleanup assignments
Gerhard Sittig [Sun, 3 Jun 2018 16:32:29 +0000 (18:32 +0200)]
input/logicport: remove obsolete reset/cleanup assignments

The in->buf truncation is done by common backend logic. The module's
cleanup() does zero out inc, which obsoletes the flag assignments.

6 years agoinput/logicport: don't re-create channels after input module reset
Gerhard Sittig [Sun, 3 Jun 2018 08:31:17 +0000 (10:31 +0200)]
input/logicport: don't re-create channels after input module reset

Split the creation of channels and groups as well as the creation of the
session feed buffer into separate routines. Re-allocate the buffer after
reset but do not re-create the channels and groups.

This implementation assumes that after reset() of the input module, the
very same set of channels (including their order, names and enabled
state, as well as group membership) results from processing the
subsequently fed file content. Reading rather different configurations
from the same input file by means of repeated reset and re-read may not
work as expected.

6 years agoinput/logicport: silence a non-fatal glib runtime assertion
Gerhard Sittig [Sun, 3 Jun 2018 06:37:10 +0000 (08:37 +0200)]
input/logicport: silence a non-fatal glib runtime assertion

Explicitly check GString pointers for validity before calling glib
routines that would access string content. This silences an assertion
error for a non-fatal runtime condition:

(process:17044): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed