diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-10-23 01:00:32 -0700 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-10-23 01:00:32 -0700 |
commit | 814183a5c41cad14b83c29c9473084e6d1a11d9b (patch) | |
tree | d409015555d828624c8c6c2546fa9c1fc1c3a3d7 /src/jtag/interface.c | |
parent | 517e812de3782a6b592cb69416d1327a9b94ac9f (diff) |
SVF: clean up, mostly for TAP state name handling
- Use the name mappings all the other code uses:
+ name-to-state ... needed to add one special case
+ state-to-name
- Improve various diagnostics:
+ don't complain about a "valid" state when the issue
is actually that it must be "stable"
+ say which command was affected
- Misc:
+ make more private data and code be static
+ use public DIM() not private dimof()
+ shorten the affected lines
Re the mappings, this means we're more generous in inputs we
accept, since case won't matter. Also our output diagnostics
will be a smidgeon more informative, saying "RUN/IDLE" not
just "IDLE" (emphasizing that there can be side effects).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/jtag/interface.c')
-rw-r--r-- | src/jtag/interface.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jtag/interface.c b/src/jtag/interface.c index e83a7723..fcdb8ee7 100644 --- a/src/jtag/interface.c +++ b/src/jtag/interface.c @@ -365,6 +365,10 @@ tap_state_t tap_state_by_name(const char *name) { tap_state_t x; + /* standard SVF name is "IDLE" */ + if (0 == strcasecmp(name, "IDLE")) + return TAP_IDLE; + for (x = 0 ; x < TAP_NUM_STATES ; x++) { /* be nice to the human */ if (0 == strcasecmp(name, tap_state_name(x))) { |