Gerhard Sittig [Sun, 16 Oct 2016 16:25:29 +0000 (18:25 +0200)]
Print error messages when decoders fail load time checks
Several checks get applied when loading externally provided protocol
decoders. Print error messages when checks fail, so that developers can
better resolve issues.
The sequence of tests terminates upon the first failed check, while
decoders may suffer from several issues at the same time. This is
considered acceptable, as it reduces the commit's size and the code's
complexity. This commit only adds error messages, and does not change
logic/behaviour.
Failed API version checks result in two messages: One specific message
which reflects the decoder's version and what's supported by the loader,
and a generic message that the API version check has failed. This is
done to simplify the logic of a rarely used error code path.
This commit addresses libsigrokdecode Bug 704, and allows to identify
decoders from parallel installations of differing version.
Gerhard Sittig [Sun, 16 Oct 2016 16:25:25 +0000 (18:25 +0200)]
.gitattributes: introduce git attributes for improved Python diffs
In the absence of respective instructions, git will use a rather generic
approach to generate diffs and patches. Introduce a git attributes file
which results in improved output for Python sources (i.e. all protocol
decoders).
Gerhard Sittig [Sun, 16 Oct 2016 16:26:18 +0000 (18:26 +0200)]
uart: skip frames with invalid start bits
When the start bit is not low at its sample point, then stop trying
to interpret the remaining frame -- it's already known to be invalid,
anyway.
Wait for the next start bit instead, assuming that either the falling
edge which started the inspection of the UART frame and its start bit
was a spurious glitch or that the captured signal does not communicate
at the decoder's configured bitrate.
Gerhard Sittig [Sun, 16 Oct 2016 16:25:28 +0000 (18:25 +0200)]
uart: rework text formatting of communicated data values, plus nits
Factor out the code which generates a textual representation for the
numeric values that were communicated via UART bit patterns. Make the
width of the output text depend on the number of bits in the UART frame
(five to nine) instead of assuming bytes of exactly eight bits.
Fix other minor issues while we are here: Nine bits result in a number
range of 0 to 511 (not 512). ASCII codes 30 and 31 are non-printables.
The previous implementation skipped a significant leading digit in the
octal representation.
Gerhard Sittig [Sun, 16 Oct 2016 16:25:27 +0000 (18:25 +0200)]
uart: minor nit, rename the "databyte" variable
Given the generic nature of UART communication and the supported range
for the data width, "byte" may be a misleading name for the numeric
value that gets communicated in five to nine data bits. Rename the
"databyte" variable to "datavalue".
Chris [Mon, 12 Sep 2016 01:14:44 +0000 (18:14 -0700)]
midi: Add support for complex MIDI message formats (inter-related).
- Handle "Running Status" where status byte can be omitted
- SysEx message can be terminated by status byte, not just EOX
- Handle SysReal messages that interrupt in-progress message transmission
- Identify and print garbage / truncated data
- Add 2 new annotations: text-sysreal-verbose and text-error
Chris Dreher [Fri, 19 Aug 2016 17:26:02 +0000 (10:26 -0700)]
midi: Substantially improve decoding of MIDI messages.
* Decode note names and percussion names (ex: 'G2', 'Tambourine').
* Decode instrument names and drum_kit names (ex: 'Flute', 'GS Orchestra Kit').
* Handle Polyphonic Pressure / Aftertouch (message 0xAn).
* Handle Program Change (message 0xCn).
* Handle Channel Pressure / Aftertouch (message 0xDn).
* Handle Channel Mode (message 0xBn mm where mm is 120 through 127).
* Handle System Common messages (message 0xF1 through 0xF6), including
full time code decoding.
* SysEx decoding now decodes the 1-3 byte manufacturer field, payload
is now displayed as hex.
* 'undefined' fields now display the value (ex: 'undefined 0xf4').
* Add 'MSB' and 'LSB' to many control_functions entries.
* Fix "trapped in state X" bug with handle_channel_msg_generic(),
though this might be dead code.
* Fix bug in sysex_manufacturer_ids; 1-byte manufacturers were not
tuples due to missing comma.
* Fix bug in SysEx decoding state machine; 0xF7 now sent to handle_sysex_msg().
Uwe Hermann [Wed, 11 May 2016 16:55:13 +0000 (18:55 +0200)]
usb_request: Drop hardcoded samplerate.
The libsigrokdecode backend now passes metadata (e.g. samplerate) to all
PDs, stacked and non-stacked (see bug #664), so this interim solution is no
longer needed.
Uwe Hermann [Fri, 29 Jan 2016 22:32:37 +0000 (23:32 +0100)]
Bump libtool version (not package version) to 3:0:0.
The last release (0.3.0) had the libtool version (current:revision:age)
set to 2:0:0. Since this release removes and changes interfaces, the new
version is 3:0:0.
This changes the library filename (e.g. on Linux) from
libsigrokdecode.so.2.0.0 to libsigrokdecode.so.3.0.0, the SONAME
(+symlink) becomes libsigrokdecode.so.3.
Daniel Thompson [Fri, 22 Jan 2016 08:29:09 +0000 (08:29 +0000)]
uart: Optimize handling of samples when tx and rx are both idle
Re-enable the fast path for identical samples but only when both
pins are waiting for the start bit. For sparse data sets (I tested
UT61E capture log) the optimization results in a >4x decode
improvement.
Petteri Aimonen [Sun, 10 Jan 2016 17:23:55 +0000 (19:23 +0200)]
arm_itm: Use objdump instead of addr2line.
This improves speed and fixes bug 564. Code is somewhat
of a copypaste from the arm_etm counterpart, but there
are enough differences that it is easier to keep separate
copy of the objdump parsing in each.
Stefan Brüns [Fri, 13 Nov 2015 04:39:10 +0000 (05:39 +0100)]
usb_signalling: decode RESET and Keep-Alive signalling conditions
Resets are at least 10ms at the root hub downstream facing port and
2.5us at the device (root hub reset may be shortened by itermediate
hubs).
Keep-alive is a low-speed only signalling condition, as low-speed has no
SOFs to inhibit devices to enter suspend
Stefan Brüns [Fri, 13 Nov 2015 04:20:22 +0000 (05:20 +0100)]
usb_signalling: use explicit positions for packet start/end
Instead of centering the block around the sampleposition, which shows
some visual glitches due to rounding, use the edge positions already
known. Remove unused halfbit symbol.
Stefan Brüns [Fri, 13 Nov 2015 03:52:53 +0000 (04:52 +0100)]
usb_signalling: remove unneeded syms array
Do not call get_eop() from get_bit(), but directly issue the symbol. As
get_eop() is only called during the GET EOP state, the SE0 is implicit and
there is no need to save it into the syms array.
Vincent Palatin [Thu, 29 May 2014 13:51:13 +0000 (06:51 -0700)]
USB Power Delivery protocol decoder
Decode and packetize the Biphase Mark Coding (aka differential Manchester)
as used in the Universal Serial Bus Power Delivery Specification Revision 2.0
v1.1, then decode the packet content.