When nothing was received in a read attempt, we need not adjust the
buffered data's read position nor the glib string object's size. Skip
any processing for empty input, just keep checking for timeouts.
Drop an initial assignment to a variable which never takes effect.
Add braces around the body of a more complex if block. Separate routines
from each other by exactly one empty line.
When the channel state is retrieved, query the pre-set byteorder for
SCPI data blocks as well. When samples get retrieved during capture,
support float representations in either big or little endian format.
This commit unbreaks devices which operate in BE format by default
(tested with HMO2524). It keeps working with LE format as before. For
devices which don't support the byteorder query or return unknown
responses, LE format is assumed for backwards compatibility. The
device's byteorder is only queried and never set. This makes the
commit least intrusive.
A comment mentioned that the models HMO2524 and above support 16 digital
channels (and thus have two pods for the probes). Move those models to a
section that declares the respective features, including trigger support
on the upper digital channels.
Model detection and reflection of supported channels was tested on HMO2524.
Commit db81fbb582 made sure to release a potentially previously
allocated list of enabled channels before (re-)building the list in the
current invocation of acquisition start.
This commit frees the memory in the error path near the failed creation
already, which reduces the period of time where unused resources are
held, and eliminates a memory leak when acquisition is not stopped after
failed start.
Both approaches can coexist. Freeing an empty list is perfectly fine.
Fix the code which registers the name of the second pod for digital
probes. The previous implementation registered the first pod twice, and
lost the reference to the second pod. No harm was done, none of the
supported models declared support for two pods so far.
Factor out a channel to group mapping in the registration of digital
channels, while we are here.
The former DER EE DE-5000 driver was a very thin wrapper around the
ES51919 LCR meter chipset. None of its source was specific to the
deree-de5000 device. In fact it contained code for all currently
supported LCR meters, and it's expected that all LCR meters which
will get added in the future will fit in as well.
Follow the serial-dmm model. Rename the src/hardware/deree-de5000/
directory to serial-lcr/. Update the configure logic. Although the
source directory and the configure option are named serial-lcr, the
LCR meter still is used by specifying the "deree-de5000" device driver
(which just happens to reside in the serial-lcr driver sources, among
others).
Introduce an asycii.c source file (modelled after metex14.c) which
implements support for the 16-byte protocol of the ASYC-II multimeter
chipset (RX only, when the PRINT button was pressed).
Buildsystem wants CXX to be defined as $(CXX).
Otherwise it fallbacks to default value, which does not contain
"-std=c++11" statement.
Other changes (like CC=$(CC) and CFLAGS=$(CFLAGS) instead of CXX ones)
is not directly fix the issue, but fix cases, where CFLAGS (and CC)
differs from CXX* ones, so it could lead to similar errors in the future.
The "deree-de5000" driver is a very thin wrapper around the ES51919
chipset. We expect more models from other vendors to use that same
support code.
Model the registration of vendor/model combinations after the serial-dmm
approach. Register the DER EE DE-5000 device as the currently only
member in a list of drivers which all use the ES51919 chipset (no model
specific routines are registered in the absence of support for other LCR
meter chips).
This commit does not change the driver's behaviour nor the set of
supported hardware. It prepares the addition of more drivers in the
future.
Factor out identical comments on the UART bitrate of ES519xx based
multimeters. These probably got copied from the first item as of 2012
when new items were added in 2014 (the added devices were from the
same vendor and rebadged).
Expand on the fact that the bitrate still is within spec, and does not
harm at all. Strictly speaking the comment could get dropped.
The previous implementation seems to have added drivers in their "order
of appearance". Start sorting the rather long list, to simplify several
tasks: Add new entries as more drivers get written, find existing items
during research, identify and compare similar models during maintenance.
As a byproduct, there will be no doubt about where to put things during
future work :) and duplicates will be spotted immediately.
This commit puts 'bm25x' meters into one group. And comments on the sort
order and motivation for sorting the table.
Commit 6bcb3ee876 introduced initial support for the Cyrustek ES51919
chipset. Its setup_channels() routine used to init a variable to assume
failure, then a loop added channels and changed the value to success.
Commit 5e23fcab88 changed channel setup to never fail, but kept the
initialization with an error code. Which prevented the operation of
successfully detected LCR meters.
Remove the no longer needed variable, instead always return success from
an operation which cannot fail.
Fixes: 5e23fcab88 "Simplify channel creation."
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
Add another DMM entry for Peaktech-3330, which is based on the FS9721
chipset. Support was tested with the CP210x based USB cable.
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
Since tastes and requirements might differ, introduce support for a
user specified character set in the construction of ASCII art graphs
of signal levels. The syntax is "charset=<low><high>[<fall><rise>]",
the default remains backwards compatible with existing consumers.
In comparison to assuming a fixed character set, this change addresses
several distinct aspects:
Users can adjust the output for "higher visual contrast", or "straight
lines" instead of dotted patterns, or "increased difference in height"
for low and high signal levels, or "filled" (block like, "wall of text")
appearance of periods with high levels. User adjustable characters are
needed, as no single fixed set can satisfy the differing expectations.
Perception of the output heavily depends on specific terminals and fonts
in use.
Then there is the issue of levels versus edges, and how their timing
relates. By default edges are drawn at a point in time where the signal
was sampled and was deteremined to already _have_ changed and have
settled to the new level, which means that the position of edges in the
resulting graph might be off by up to one sample period. Strictly
speaking, the available set of samples only contains levels, and does
not hint where exactly an edge might have occured. Though this might be
considered rather nitpicky, representing the graph without edges does
better reflect the input data, and might simplify postprocessing.
Compare the previously only supported format (still the default, -O ascii):
1:...................................................../""""""""""""""""""""
1:""""""""""""""""""""""""""""""""\.........................................
1:..........................................................................
to those example alternatives:
$ sigrok-cli -i file.sr -O ascii:charset=_\"\\/
1:_____________________________________________________/""""""""""""""""""""
1:""""""""""""""""""""""""""""""""\_________________________________________
1:__________________________________________________________________________
$ sigrok-cli -i file.sr -O ascii:charset=_\"
1:_____________________________________________________"""""""""""""""""""""
1:""""""""""""""""""""""""""""""""__________________________________________
1:__________________________________________________________________________
$ sigrok-cli -i file.sr -O ascii:charset=_^
1:_____________________________________________________^^^^^^^^^^^^^^^^^^^^^
1:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__________________________________________
1:__________________________________________________________________________
$ sigrok-cli -i file.sr -O ascii:charset=_M
1:_____________________________________________________MMMMMMMMMMMMMMMMMMMMM
1:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM__________________________________________
1:__________________________________________________________________________
$ sigrok-cli -i file.sr -O ascii:charset=_X
1:_____________________________________________________XXXXXXXXXXXXXXXXXXXXX
1:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX__________________________________________
1:__________________________________________________________________________
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
We now require the use of the latest fx2lafw firmware which uses the
same USB VID/PID (1D50:608E) for the Hantek 6022BE and the variants
and rebadges of that device (e.g. the SainSmart DDS120).
The variants can be distinguished via the USB product version field.
This allows much faster and configurable sampling rate, and faster
reaction to function switch.
This also gives a more repeatable job ordering and more reliable
query/reply association.