Commit Graph

4555 Commits

Author SHA1 Message Date
Uwe Hermann d1ac53ccd5 drivers: Start counting at 0 for some loops. 2017-08-06 17:31:46 +02:00
Uwe Hermann b3fd09937c drivers: Use NUM_CHANNELS in favor of hardcoded values. 2017-08-06 17:31:46 +02:00
Uwe Hermann bd633efa32 drivers: Use std_*idx*() helpers in some more places. 2017-08-03 16:35:19 +02:00
Uwe Hermann 76f0fa5dfb lecroy-xstream: Use array-based approach for timebases/vdivs.
This makes the driver more consistent with the rest of the code-base
and allows us to use the new array helpers in a few more places.
2017-08-03 16:35:19 +02:00
Uwe Hermann 692716f5d1 drivers: Use array-based approach in some places.
This allows us to use the new array helpers in a few more places.
2017-08-03 16:35:19 +02:00
Uwe Hermann 373e92a491 drivers: Consistently name SCPI helper functions 'probe_device'. 2017-07-31 16:23:32 +02:00
Uwe Hermann 21fe5dba36 drivers: Drop some unneeded voltage_/volt_ prefixes. 2017-07-31 16:23:32 +02:00
Uwe Hermann e124cf9b7a drivers: Drop some unneeded _names suffixes. 2017-07-31 16:23:32 +02:00
Uwe Hermann efad7cccec drivers: SR_CONF_CAPTURE_RATIO fixes.
Move the check for the capture ratio being 0..100 into the wrappers,
drop unneeded helper functions, fix incorrect variable types, minor
other consistency fixes.
2017-07-31 16:23:32 +02:00
Uwe Hermann 758906aa71 drivers: Remove some unneeded 'ret' variables. 2017-07-31 16:23:31 +02:00
Uwe Hermann 50ccb36f20 drivers: Random SR_CONF_LIMIT_* cleanups.
Drop unneeded variables and checks (performed by the wrappers already).
2017-07-31 16:23:31 +02:00
Uwe Hermann 697fb6ddfc drivers: Factor out std_*_idx*(). 2017-07-31 16:23:31 +02:00
Uwe Hermann 94e64a0b89 drivers: Replace struct voltage_threshold with an array.
This makes the code-base more consistent and will allow for wider usage
of upcoming array helper functions.
2017-07-31 16:23:31 +02:00
Uwe Hermann 87dc541027 drivers: Move SR_ERR_CHANNEL_GROUP log messages to wrappers. 2017-07-31 16:23:31 +02:00
Uwe Hermann 00ed77f27c drivers/input: Remove some hardcoded values. 2017-07-31 16:23:31 +02:00
Uwe Hermann 95c1fe62f7 drivers: Use g_variant_new_printf() where possible. 2017-07-31 16:23:31 +02:00
Uwe Hermann 9fb9afb573 drivers: Factor out std_gvar_thresholds(). 2017-07-31 16:23:31 +02:00
Uwe Hermann 43995cda36 drivers: Factor out std_gvar_tuple_double(). 2017-07-31 16:23:31 +02:00
Uwe Hermann a162eeb2e8 drivers: Factor out std_gvar_tuple_u64(). 2017-07-31 16:23:31 +02:00
Uwe Hermann dd7a72ea69 drivers: Consistently use same indentation for config_*() API calls. 2017-07-31 16:23:31 +02:00
Uwe Hermann 58ffcf9712 std_gvar_tuple_array(): Change to allow for more ARRAY_AND_SIZE usage.
Thanks to Marcus Comstedt <marcus@mc.pp.se> for the hint!
2017-07-21 19:04:34 +02:00
Uwe Hermann 8dacbcf68f drivers: Consistently use the exact driver name as LOG_PREFIX. 2017-07-21 18:46:27 +02:00
Uwe Hermann f272d7ddc0 drivers: Consistently make LOG_PREFIX the first item after #includes. 2017-07-21 18:46:27 +02:00
Uwe Hermann b15ff1c92a drivers: Eliminate some unnecessary vendor/model #defines.
Most drivers use the vendor/model strings directly already; make all
of them do that consistently.
2017-07-21 18:46:26 +02:00
Uwe Hermann f8195cb2da drivers: Shorten some unnecessarily long arrays. 2017-07-21 17:06:40 +02:00
Uwe Hermann 76d10d1324 drivers: Consistently use the name trigger_matches[] everywhere. 2017-07-21 17:06:40 +02:00
Uwe Hermann 9e411f4be8 rigol-ds: config_set: Move error printing to wrapper. 2017-07-21 17:06:40 +02:00
Uwe Hermann 0f8bee7162 rigol-ds: Update a code comment. 2017-07-21 17:06:40 +02:00
Uwe Hermann 396cdca0c3 rigol-ds: Drop two unneeded #defines. 2017-07-21 17:06:40 +02:00
Uwe Hermann 53012da658 drivers: Use ARRAY_AND_SIZE where possible. 2017-07-21 17:06:40 +02:00
Uwe Hermann 105df67463 drivers: Factor out std_gvar_array_*(). 2017-07-21 16:54:05 +02:00
Uwe Hermann 7bc3cfe6ff drivers: Factor out std_gvar_min_max_step_thresholds(). 2017-07-21 16:54:05 +02:00
Uwe Hermann bcee129962 scpi-pps: Change some floats to doubles.
This makes the code more consistent with the rest of the code-base
and also allows std_gvar_min_max_step_array() to work here.

Without this change:

  src/hardware/scpi-pps/api.c: In function ‘config_list’:
  src/hardware/scpi-pps/api.c:570:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->voltage);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:573:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->frequency);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/hardware/scpi-pps/api.c:576:40: warning: passing argument 1 of ‘std_gvar_min_max_step_array’ from incompatible pointer type [-Wincompatible-pointer-types]
      *data = std_gvar_min_max_step_array(ch_spec->current);
                                          ^~~~~~~
  In file included from src/scpi.h:30:0,
                   from src/hardware/scpi-pps/api.c:23:
  src/libsigrok-internal.h:964:19: note: expected ‘const double *’ but argument is of type ‘const float *’
   SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-07-21 16:49:01 +02:00
Uwe Hermann 54d471f498 drivers: Factor out std_gvar_min_max_step{,_array}(). 2017-07-21 16:49:01 +02:00
Uwe Hermann 463160cbca drivers: Factor out std_gvar_samplerates{,_steps}(). 2017-07-21 16:49:01 +02:00
Uwe Hermann db944f1622 drivers: Factor out std_gvar_tuple_{array,rational}(). 2017-07-21 16:40:15 +02:00
Uwe Hermann 6b82c3e57a drivers: Consistently name per-cg options 'devopts_cg_*'. 2017-07-21 15:45:03 +02:00
Uwe Hermann 4b25cbffa1 drivers: Drop some unnecessary prefixes. 2017-07-21 15:45:03 +02:00
Uwe Hermann ca314e060f drivers: Drop unneeded or duplicate comments.
Drop various comments which are not really needed, too verbose, document
obvious things, are duplicated across all drivers, or simply incorrect.
2017-07-21 15:23:56 +02:00
Uwe Hermann c8e789fa0c baylibre-acme: Add SR_CONF_POWERMETER key. 2017-07-19 15:40:41 +02:00
Uwe Hermann 31bdc10ec2 Add SR_CONF_POWERMETER. 2017-07-19 15:40:41 +02:00
Uwe Hermann b258c09f26 testo: Drop unneeded sdi->driver assignment.
This is already done by std_scan_complete().
2017-07-19 15:39:23 +02:00
Uwe Hermann 05199c0ac9 drivers: Provide proper drvopts.
The device class config keys should be in drvopts (not devopts).
2017-07-19 15:39:23 +02:00
Uwe Hermann 55fb76b348 drivers: Always use same scanopts/drvopts/devopts/devopts_cg* order. 2017-07-19 15:11:01 +02:00
Uwe Hermann e66d1892d0 drivers: Add and use STD_CONFIG_LIST().
This ensures consistent handling of the SR_CONF_SCAN_OPTIONS and
SR_CONF_DEVICE_OPTIONS (with sdi NULL or non-NULL) config keys
and also reduces copy-pasted boilerplate in the drivers a bit.

This function does not handle channel-group specific items, that's
very driver-specific and thus left to the individual drivers.

Also move some generic checks and error messages from the drivers into
the sr_config_list() wrapper.
2017-07-19 15:11:01 +02:00
Uwe Hermann 13d2ac54f4 saleae-logic-pro: Use sr_dev_acquisition_stop() wrapper. 2017-07-17 11:26:12 +02:00
Jan Luebbe f2b8a31be5 saleae-logic-pro: Detect and abort on capture errors
The HW simply stops sending data on overflows, so if we receive no data
in one second, we abort the acquisition. We also need to allocate more
buffers to support higher sample rates.
2017-07-16 19:28:58 +02:00
Jan Luebbe da39089014 saleae-logic-pro: Implement bitstream upload and initialization
The control packets can be longer than 256 bytes, so change the
low-level functions accordingly.
2017-07-16 19:25:46 +02:00
Jan Luebbe f1aca068c7 saleae-logic-pro: Implement FX3 firmware upload 2017-07-16 19:24:27 +02:00
Uwe Hermann a9010323dd drivers: Remove some uneeded 'ret' variables. 2017-07-13 11:59:11 +02:00