Uwe Hermann [Tue, 22 May 2012 23:12:11 +0000 (01:12 +0200)]
srd: onewire: Fix incorrect format for annotation output.
Should be a list containing:
- Annotation format number (e.g. 0, or ANN_DEC, etc).
- A list of strings (the annotation). If more than one string is
supplied, the other ones should be short versions of the string.
Example: [ANN_DEC, ["Foobarbaz", "Foo", "F"]]
As per guidelines in HACKING, the protocol "commands"/items should be ALLCAPS,
thus change 'data' to 'DATA'. Also, fix MX25Lxx05D protocol decoder
accordingly, currently the only one we have which stacks on top of SPI.
Add a new 'CS-CHANGE' output protocol item, which is sent upon every
change of the CS# pin value (either 0->1, or vice versa). This is needed
by various higher-level PDs.
Pekka Nikander [Fri, 11 May 2012 16:23:21 +0000 (19:23 +0300)]
sr/srd/cli: Fix compiling with Homebrew.
Add ACLOCAL_DIR setting and AM_PROG_AR macro for compiling with Homebrew
under Mac OS X.
Applies essentially the same change to
{libsigrok,libsigrokdecode,sigrok-cli}/{autogen.sh,configure.ac}
It may be that the same fix is needed for the other autogen.sh and/or
configure.ac files, but that hasn't been tested and therefore not in
this commit.
Uwe Hermann [Thu, 10 May 2012 07:34:13 +0000 (09:34 +0200)]
srd: Support for one or more optional probes.
In the protocol decoder you always get all required probes, then _all_
optional probes in the list of probes in the decode() call.
Example:
(r1, r2, r3, o1, o2, o3, o4) = pins
In this case r1-r3 are required probes, o1-o4 are optional probes.
However, the value of valid/used/specified probes will be 0 or 1,
whereas the value of probes that were not specified/assigned by the user
will be (at the moment) 42.
The PD can check for a valid probe like this:
if p in (0, 1):
...
Or check for an invalid probe:
if (p > 1):
...
The value of 42 could change to be -1 or None later.
Uwe Hermann [Sat, 28 Apr 2012 17:24:14 +0000 (19:24 +0200)]
srd: jtag: Various bugfixes.
Most importantly, both TDI and TDO are sampled at the rising TCK edge,
and only upon transitions from SHIFT-DR to SHIFT-DR and SHIFT-IR to SHIFT-IR
are we to save the TDI/TDO values (if I understood this correcly).
Also, start out in RUN-TEST/IDLE state for now. This is useful if you
have JTAG dumps which start "in the middle" somewhere, not in the
TEST-LOGIC-RESET state. For full dumps, the JTAG software usually issues
five TMS=1 cycles to force the JTAG state machine into TEST-LOGIC-RESET
anyway, so this works fine too.
Uwe Hermann [Wed, 21 Mar 2012 21:33:51 +0000 (22:33 +0100)]
sr/srd: Remove API warnings from READMEs.
We'll have a libsigrok and a libsigrokdecode release soon. After that,
any API changes must be properly documented and reflected in the
SO version (and package version) numbers of the libs.
Uwe Hermann [Wed, 21 Mar 2012 18:40:07 +0000 (19:40 +0100)]
srd: Drop ebr30a_i2c_demux in favor of i2cdemux.
The i2cdemux protocol decoder is the more generic version of the
obsolete ebr30a_i2c_demux decoder, and should be able (now or later) to do
everything that ebr30a_i2c_demux can do.
Uwe Hermann [Sat, 11 Feb 2012 21:09:18 +0000 (22:09 +0100)]
Rename 'void *' callback parameters to 'user_data'.
This is better, both for consistency reasons, and also because 'data' is
a bit too generic and might be confusing, especially since we have other
'data' fields in the code in various places.
Uwe Hermann [Sat, 11 Feb 2012 19:06:46 +0000 (20:06 +0100)]
Use g_try_malloc/g_free/g_strdup consistently.
Avoid plain malloc()/free() in sr/srd, especially in the API calls.
Also avoid g_malloc*() in favor of g_try_malloc*().
Use g_strdup() instead of strdup() so that we can use g_free()
consistently everywhere.
Exceptions: Stuff that is allocated via other libs (not using glib),
should also be properly free'd using the respective free-ing function
(instead of g_free()). Examples: Stuff allocated by libusb, libftdi, etc.
Also, use sr_err() instead of sr_warn() for actual errors. sr_warn() is
meant for non-fatal/uncritical warnings.