The version text length check fails for git setups that use more digits
in abbreviated hashes, as is recommended by e.g. the Linux kernel project.
Raise the upper limit for acceptable version strings, and add comments
on how the limits were determined. The test still might fail in setups
of slightly different configuration, but now it's easier to see why the
test failed, and how to adjust the test.
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
Fix the array size check in the sigma_write_register() routine. The
'len' parameter specifies the number of bytes to write, while the 'buf'
array holds one nibble per array item.
The previous implementation (commit e8686e3ae3) switched to a
constant size and made the buffer large enough so that no existing
request would exceed the buffer, fixing an overflow that was present
before that commit. But the most recent size check was incomplete and
might erroneously succeed for larger amounts of write data.
It's assumed that the issue which gets addressed here never occured in
practice. The constant-size buffer could hold up to 39 bytes of input
data in their transport representation, while the largest data that was
passed to the write routine is six bytes (trigger LUT params).
Fixes: e8686e3ae3 "asix-sigma: Avoid use of variable length arrays"
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
The driver internally implements the "limit samples" feature by means of
the "limit sample period" approach. Determination of the corresponding
period of time for captures depends on the sample rate as well as the
maximum sample count, and thus needs to be re-done when either setting
changes.
Introduce a "limit_samples" variable so that the value is available when
needed later. As a byproduct the parameter can be retrieved now (get).
Add comments to the sigma_set_samplerate() routine's sections, since
quite a bit is happening there, and interacts with other locations.
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
Commit 2c9c0df86e removed the sentinel from the samplerates[] array,
but did not adjust the test which checked whether a rate is listed in
the set of supported rates. This could result in an out-of-range access
beyond the array's last item.
Fix the "listed?" check after iterating the table of supported rates.
Cope with either presence or absence of a sentinel in the array.
Address some more style nits while we are here. Rename an identifier
for a local variable which unintentionally might suggest that it would
be a preprocessor macro (all-caps). Reduce redundancy in data type
references as well as in the determination of the array size.
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
The current implementation of the ASIX Sigma firmware download contains
comments which express uncertainty. Rephrase them, no magic is involved.
Discuss the polarity of the CCLK hardware signal. Which shall eliminate
potential concerns in future reviews or maintenance.
This commit only updates comments, and does not change behaviour.
Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
Don't show duplicate lines (per default) such as
sr: resource: Failed to locate 'saleae-logic16-fx2.fw'.
sr: resource: Failed to open resource 'saleae-logic16-fx2.fw'.
The first one is now an sr_dbg() instead of sr_err().
Also, mention that a higher loglevel will give more information as to
where the backend is looking for resources / firmware files.
This fixes bug #806.
This change tweaks the CSV output module to change the label
setting from on/off to units/channels/off, where channels is the old
on behavior, and units uses the meaning field to generate the column
label - except for the generated Time column, which uses the label from
the X axis when it's generating gnuplot output.
- It now handles more than one analog value correctly - at least from the
demo driver.
- Add column headers from channel names.
- Add a row dedup capability.
- Add a sample time column.
- Add a frame end formatting (for gnuplot).
- Made almost all formatting controllable or at least optional.
- Fix it so we can mix analog and digital values.
- Add outputting a gnuplot script for the data.
- Count actual channels, not just mine, to find end of sample.
- Add trigger option (untested).
The default so far was 0, which meant there would be no significant
digits at all, yielding results that looked strange/wrong to the user.
Long-term all remaining drivers should be fixed to use the actual,
correct digits and spec_digits values according to the device's
capabilities and/or datasheet/manual. Until that is done, a default
of digits=2 is used as a temporary workaround.
This fixes the remaining parts of bug #815.