diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-03 00:24:21 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-03 00:24:21 +0000 |
commit | f0b1b206cdba41ce2322db680f37c27ff3ae3478 (patch) | |
tree | fe2a7bc0e647313b81918ac13b6fdcf6e79c2890 /src | |
parent | 2c69be13ea143fded2ad33b2b8405003c34e50ba (diff) | |
download | openocd+libswd-f0b1b206cdba41ce2322db680f37c27ff3ae3478.tar.gz openocd+libswd-f0b1b206cdba41ce2322db680f37c27ff3ae3478.tar.bz2 openocd+libswd-f0b1b206cdba41ce2322db680f37c27ff3ae3478.tar.xz openocd+libswd-f0b1b206cdba41ce2322db680f37c27ff3ae3478.zip |
Split and simplify handle_tms_sequence_command for further factoring.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2010 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/interface.h | 3 | ||||
-rw-r--r-- | src/jtag/jtag.c | 25 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/jtag/interface.h b/src/jtag/interface.h index 2f9f7373..db0dfb70 100644 --- a/src/jtag/interface.h +++ b/src/jtag/interface.h @@ -167,6 +167,9 @@ const char* tap_state_name(tap_state_t state); /// Provides user-friendly name lookup of TAP states. tap_state_t tap_state_by_name(const char *name); +/// Allow switching between old and new TMS tables. @see tap_get_tms_path +void tap_use_new_tms_table(bool use_new); + #ifdef _DEBUG_JTAG_IO_ /** * @brief Prints verbose TAP state transitions for the given TMS/TDI buffers. diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 5fdc070b..de4173e4 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -3223,24 +3223,27 @@ tap_state_t jtag_debug_state_machine(const void *tms_buf, const void *tdi_buf, } #endif // _DEBUG_JTAG_IO_ +void tap_use_new_tms_table(bool use_new) +{ + tms_seqs = use_new ? &short_tms_seqs : &old_tms_seqs; +} + static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { + if (argc > 1) + return ERROR_COMMAND_SYNTAX_ERROR; + if (argc == 1) { + bool use_new_table; if (strcmp(args[0], "short") == 0) - { - tms_seqs=&short_tms_seqs; - } + use_new_table = true; else if (strcmp(args[0], "long") == 0) - { - tms_seqs=&old_tms_seqs; - } else - { + use_new_table = false; + else return ERROR_COMMAND_SYNTAX_ERROR; - } - } else if (argc != 0) - { - return ERROR_COMMAND_SYNTAX_ERROR; + + tap_use_new_tms_table(use_new_table); } command_print(cmd_ctx, "tms sequence is %s", (tms_seqs==&short_tms_seqs) ? "short": "long"); |