Commit Graph

4630 Commits

Author SHA1 Message Date
Gerhard Sittig 69229e5c15 saleae-logic-pro: style nits, copy loop vs memcpy 2018-03-03 18:58:59 +01:00
Gerhard Sittig 093b8ff478 pce-322a: style nits, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig c372070333 mic-985xx: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig 7a65106e00 kern-scale: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig 0f6ff97bf8 center-3xx: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Uwe Hermann bdbb9151af siglent-sds: Drop superfluous log message.
This information is already emitted by other layers.
2018-03-03 18:45:58 +01:00
marchelh fdf0744fa4 siglent-sds: Added trigger position to device config code 2018-03-03 17:46:15 +01:00
marchelh e8fd027120 siglent-sds: Fixed issue with hard coded vdiv. 2018-03-03 17:46:15 +01:00
marchelh fe06061d96 siglent-sds: Drop unused variable from siglent_sds_read_header function 2018-03-03 17:45:21 +01:00
marchelh fe1aa53613 siglent-sds: Added averaging function. 2018-03-03 17:45:21 +01:00
marchelh 80eba3857a siglent-sds: Fixed timebase problem where NS could not be selected
This fixes bug #1120.
2018-03-03 17:28:49 +01:00
Frank Stettner d8df3c2a01 tests: Fix incomplete fail message for locale tests. 2018-02-21 11:37:19 +01:00
Frank Stettner 93497d0016 hp-3478a: Fix compiler warning. 2018-02-21 11:37:19 +01:00
Romain Tartière 6c1a76d126 Check usb_get_port_path() return value
This function can fail. If so, do not ignore the failure.
2018-02-21 11:37:19 +01:00
Romain Tartière 7bbe5a2b6a Ensure device is closed before usb_get_port_path()
The usb_get_port_path() function opens the passed device on FreeBSD,
which fails if the device has already been open.

This fixes bug #1109.
2018-02-21 11:36:58 +01:00
Gerhard Sittig 90cc52260c bindings/ruby: include config.h before any other header file 2018-02-21 11:19:17 +01:00
Gerhard Sittig 21964348bc bindings/python: include config.h before any other header file 2018-02-21 11:19:17 +01:00
Gerhard Sittig 1e95832b3e bindings/cxx: include config.h as early as possible
Move the inclusion of <config.h> before any other source code.
2018-02-21 11:19:17 +01:00
Gerhard Sittig dea7f6342a pce-322a: include config.h before any other header file 2018-02-21 11:19:17 +01:00
Uwe Hermann 5a64d1d954 beaglelogic: Use UINT64_MAX instead of (uint64_t)-1. 2018-02-20 20:03:21 +01:00
Uwe Hermann 71e22ba88f beaglelogic: Drop unneeded uint64_t cast. 2018-02-20 20:03:21 +01:00
Uwe Hermann 3f4c1174b6 lecroy-xstream: Fix potential issue by adding UINT64_C. 2018-02-20 20:03:21 +01:00
Uwe Hermann d9b716fc5f Use UINT64_C instead of "ULL" number suffix.
Avoid hardcoding a "ULL" number suffix, use the more portable and more
correct UINT64_C.
2018-02-20 20:03:21 +01:00
Uwe Hermann 405b9c10eb Random whitespace/cosmetic fixes. 2018-02-20 20:03:11 +01:00
Uwe Hermann 1135f8d9c7 siglent-sds: Fix two memory leaks. 2018-02-18 23:36:17 +01:00
Uwe Hermann d6d87fa2a2 siglent-sds: Drop incorrect glib includes. 2018-02-18 23:29:14 +01:00
Uwe Hermann 04c4a6776f hp-3478a: Shorten some functions. 2018-02-18 23:18:22 +01:00
Uwe Hermann 6ddedf5bac hp-3478a: Drop superfluous log message prefixes. 2018-02-18 23:13:34 +01:00
Frank Stettner d2c1730a28 hp-3478a: Initial HP 3478A diver 2018-02-18 23:13:34 +01:00
Frank Stettner 1d9eebf4be hp-3478a: Initial driver skeleton. 2018-02-18 22:59:31 +01:00
Uwe Hermann 374b0a94b2 output/analog: Fix a compiler warning on Mac OS X.
Apparently PRIu64 and G_GUINT64_FORMAT differ on some systems for
unknown reasons. Use G_GUINT64_FORMAT to get rid of the warning
for now.
2018-02-18 21:36:18 +01:00
Uwe Hermann 65788048f0 Fix two compiler warnings on MinGW/MSYS2.
The config.h file must always be included as first file.

  src/output/csv.c: In function 'gen_header':
  src/output/csv.c:64:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "output/csv"
                      ^
  ./src/libsigrok-internal.h:753:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_info(...) sr_log(SR_LOG_INFO, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/output/csv.c:244:3: note: in expansion of macro 'sr_info'
     sr_info("Set sample period to %" PRIu64 " %s",
     ^
  src/output/csv.c: In function 'dump_saved_values':
  src/output/csv.c:462:34: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
       g_string_append_printf(*out, "%" PRIu64 "%s",
                                    ^

  In file included from src/hardware/ftdi-la/protocol.c:21:0:
  src/hardware/ftdi-la/protocol.c: In function 'send_samples':
  src/hardware/ftdi-la/protocol.h:28:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "ftdi-la"
                      ^
  ./src/libsigrok-internal.h:751:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_spew(...) sr_log(SR_LOG_SPEW, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/hardware/ftdi-la/protocol.c:29:2: note: in expansion of macro 'sr_spew'
    sr_spew("Sending %" PRIu64 " samples.", samples_to_send);
    ^
2018-02-18 21:36:12 +01:00
Uwe Hermann e8e063738d siglent-sds: Fix multiple compiler warnings. 2018-02-18 17:40:59 +01:00
Uwe Hermann 567c6501d9 siglent-sds: Remove unused variable. 2018-02-18 17:14:08 +01:00
Frank Stettner 94b1d50642 dmm: Remove unnecessary casts 2018-02-18 17:08:06 +01:00
Frank Stettner 7fb4ff0237 metex14: Add missing modes and set correct digits value. 2018-02-18 17:08:06 +01:00
Gerhard Sittig 556a926d43 serial-dmm, metex14: add support for multiple channels per DMM
Optionally create multiple analog channels in serial-dmm's scan()
routine. Allow the meters' parse routines to fill in more than one
analog value from the inspection of a single packet.

Use "large" (4 times 14 bytes) packets for the Metex M-3860M and the
PeakTech 4390A meters, and have those large packets parsed by wrapping
the routines for regular 14-byte Metex packets, and sending four values
to the session bus after reception of one large packet.

Thanks to Frank Stettner <frank-stettner@gmx.net> for testing and
fixing the initial implementation of this extension.
2018-02-18 15:43:34 +01:00
Gerhard Sittig 51e1f5661c serial-dmm: style nit (init vs assign, memmove(3))
Move the initial assignment to the 'offset' variable to the very spot
where it gets evaluated and subsequently manipulated.

Replace a DIY copy loop with the corresponding memmove(3) call.
2018-02-18 15:43:34 +01:00
Uwe Hermann e4fb1a821d siglent-sds: Bring driver up-to-date with current code conventions.
Use ARRAY_AND_SIZE where possible, use std.c helpers where possible,
make scanopts/drvopts/devopts consistent with other drivers.
2018-02-17 19:10:19 +01:00
Uwe Hermann 8856f173df siglent-sds: Drop obsolete SR_ST_ACTIVE checks.
These are now done in the wrapper functions.
2018-02-17 19:10:19 +01:00
Uwe Hermann e5896840f6 siglent-sds: Random cosmetics, drop unused stuff. 2018-02-17 19:10:19 +01:00
Uwe Hermann 641107aa6c siglent-sds: Use PRIu64 for uint64_t variables.
This fixes various compiler warnings on some systems.
2018-02-17 16:01:58 +01:00
Uwe Hermann 2dedd64e11 siglent-sds: Fix SR_CONF_TRIGGER_SLOPE config_set() code.
Also use "r" and "f" as trigger slope values for now, since that's
what most other drivers do currently.

This also fixes two scan-build issues:

  api.c:559:3: warning: Value stored to 'tmp_str' is never read
                  tmp_str = g_variant_get_string(data, NULL);
                  ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  api.c:561:9: warning: Use of memory after it is freed
                  ret = siglent_sds_config_set(sdi, "%s:TRSL %s",
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-02-17 00:51:53 +01:00
Uwe Hermann a7f066bfca udev: Add entries for Siglent USBTMC devices. 2018-02-17 00:51:53 +01:00
Uwe Hermann 70cfec9a14 siglent-sds: Add 100s timebase (seen on e.g. SDS1202X-E). 2018-02-17 00:51:53 +01:00
Uwe Hermann afcbb911f8 siglent-sds: Add SDS1052DL+ model. 2018-02-17 00:51:53 +01:00
Uwe Hermann 3e7fb88f21 siglent-sds: Various cosmetics and coding-style fixes.
Also, drop some unneeded comments and log messages.
2018-02-17 00:51:53 +01:00
Uwe Hermann 4868f15a86 hantek-4032l: Minor cosmetics. 2018-02-15 22:45:35 +01:00
Uwe Hermann d18bf7bdfc std.c: Add missing <sys/time.h> #include and _XOPEN_SOURCE.
This is required for gettimeofday() to be available (at least on
FreeBSD), causes compiler warnings otherwise.
2018-02-13 23:10:33 +01:00
Uwe Hermann a9a38e7511 siglent-sds: Replace non-portable strcasestr() with g_strstr_len().
The strcasestr() function is non-portable (e.g. not available on
MinGW, possibly elsewhere). Replace it with g_strstr_len() for the time
being. While the latter is not case-insensitive it appears that
that property doesn't matter here ("." should not be relevant anyway,
and e.g. an SDS1202X-E does indeed report "Mpts" as such).

Should it become necessary to have this code be case-insensitive,
we'll have to find a more portable solution than strcasestr().
2018-02-13 22:45:22 +01:00