diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-23 03:42:13 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-23 03:42:13 +0000 |
commit | b11a5b07c6ac9abcb1b2d481da3e3cf1e0292057 (patch) | |
tree | 2d06da24710ef3c832ff86b6d14d30ba791d55bd /src/ecosboard.c | |
parent | 96d3de002daa1b139da56106efd903c376abc06f (diff) | |
download | openocd_libswd-b11a5b07c6ac9abcb1b2d481da3e3cf1e0292057.tar.gz openocd_libswd-b11a5b07c6ac9abcb1b2d481da3e3cf1e0292057.tar.bz2 openocd_libswd-b11a5b07c6ac9abcb1b2d481da3e3cf1e0292057.tar.xz openocd_libswd-b11a5b07c6ac9abcb1b2d481da3e3cf1e0292057.zip |
Submitted by Magnus Lundin <lundin@mlu.mine.nu>:
Updates to the J-Link interface driver to support more device versions:
- Add capability detection:
- if capable, detect protocol version; otherwise, assume v2 protocol.
- if capable, detect buffer size; otherwise, assume minimal.
- Disable command result queries for devices using v2 protocol.
- Defined and use JTAG2 command with v2 protocol; JTAG3 is v3 protocol.
- Add TCL command to allow explicit setting of J-Link protocol version.
With approval, I revised the patch to make the following changes:
- add static keywords to new jlink-specific variables
- factor calculation of major_version to be more readable
- remove braces around simple one-line statements in if/else clauses
- remove (rather than #if 0) duplicate reset code; it is in SVN
- use &function to be clearer when passing function pointers
- add symbols for EMU_CMD_GET_CAPS bits; do not hard-code constants!
- almost renamed jlink_handle_jlink_hw_jtag_command (seriously?!?!)
- rewrote that function using a switch statement.
- made version request processing easier to understand and modify
- improve alternate endpoint detection:
- make code easier to read by using temporary variables
- eliminate extra level of indentation and redundant logging
- use ternary conditional to select JTAG2 or JTAG3 command
- reverse version test in jlink_usb_message to reduce indentation
- this had the biggest effect in cleaning up this patch
- use C99's ability to declare new/changed variables with less scope
- add spaces around binary operators in new/changed code
- revert other superfluous whitespace/comment style changes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1889 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/ecosboard.c')
0 files changed, 0 insertions, 0 deletions