Move the declaration of codes for pattern types before the declaration
of the context container such that the latter can reference the former.
Add 'int' to an unsigned variable that omitted the base type.
When auto-detection tries to find the input module that can handle a
file, unexpected input format should be considered non-fatal. Only emit
error messages when process_header() got invoked from process_buffer()
after initialization. Emit debug messages in early stages where no input
module context exists yet.
The initial voltage threshold in dev_open() was being set to a
default value in the devc->cur_threshold variable but not actually set
in the device itself.
Patch by Jörg Alpers <jalpers@gmx.net>, thanks a lot!
- fix LIBUSB_TIMEOUT errors
- fix same data receiving
- send reset vendor request before new data getting
- decrease USB polling timeout
This fixes bug #1190.
Signed-off-by: Andrej Valek <andy@skyrain.eu>
- use pragma to handle different behavior between gcc and minGW bit-field packing
- bit-field integer variables needs to be align to 2-byte boundary
Compiler does not produce an error when accessing into non-__packed pointer.
However, the field might not be properly aligned for this type.
More information could be found on:
- https://sourceforge.net/p/mingw-w64/bugs/275/
- http://www.keil.com/support/man/docs/ARMCC/armcc_chr1359124990875.htm
Signed-off-by: Andrej Valek <andy@skyrain.eu>
Before this change, the loglevel check would only be performed for the
default log handler in libsigrok, but not for other handlers set
via sr_log_callback_set().
This fixes bug #698.
A local buffer was too small, snprintf() was used to write the
name of the analog-1-1-xxx ZIP archive names in that buffer.
Due to the limited size, only 3 characters were usable for the last
number component, i.e. the code would loop around from analog-1-1-999
to analog-1-1-100 (instead of analog-1-1-1000).
As a quickfix, increase the buffer size by a large margin, a nicer
fix should be used later on.
These trigger quite often with unrelated devices and confuse people.
scpi_usbtmc: Failed to get configuration descriptor: LIBUSB_ERROR_NOT_FOUND, ignoring device.
The Modbus RTU implementation was inappropriately returning lengths
from the serial functions when the calling functions expect only an
sr_error_code value.
Make sure to not exceed the ctx->analog_samples[] array bounds. Don't
use the (huge) channel's index in the device's(!) channel list, instead
use the zero-based and dense index into the array of analog samples in
the accumulation buffer, before writing to the external file.
This fixes the segfault reported in bug #1124.
The process_analog() logic is rather complex, dealing with the total
list of channels in the device (which can be of different types), and a
number of submitted samples for a specified list of channels. Replace
the rather short variable names for i, j, c (and num_channels) with
something longer that hopefully increases readability of the complex
loop bodies.
Note that this change merely renames identifiers, and does not change
behaviour.
Instead of nesting indentation levels upon equality of a value, skip
iterations upon inequality. This reduces indentation, and might improve
readability.
[ Indentation changes, see 'diff -w -b' for the essence. ]