summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-07 05:22:09 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-07 05:22:09 +0000
commit0b08845e3fdd79c1ddf0ed3e98623eaff5f65188 (patch)
tree5ee6d0023098539d0064a91aa14694f9e6a763b1 /src
parent43e1ed244fdd58804c2453b51e636d3a755a7c5d (diff)
downloadopenocd_libswd-0b08845e3fdd79c1ddf0ed3e98623eaff5f65188.tar.gz
openocd_libswd-0b08845e3fdd79c1ddf0ed3e98623eaff5f65188.tar.bz2
openocd_libswd-0b08845e3fdd79c1ddf0ed3e98623eaff5f65188.tar.xz
openocd_libswd-0b08845e3fdd79c1ddf0ed3e98623eaff5f65188.zip
Factoring of jtag_examine_chain for maintainability:
- Move JTAG EXTRACT macros out from the middle of jtag_examine_chain. git-svn-id: svn://svn.berlios.de/openocd/trunk@2078 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/jtag.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index af063433..2b6d37ba 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -943,6 +943,10 @@ void jtag_sleep(u32 us)
alive_sleep(us/1000);
}
+#define EXTRACT_MFG(X) (((X) & 0xffe) >> 1)
+#define EXTRACT_PART(X) (((X) & 0xffff000) >> 12)
+#define EXTRACT_VER(X) (((X) & 0xf0000000) >> 28)
+
/* Try to examine chain layout according to IEEE 1149.1 §12
*/
static int jtag_examine_chain(void)
@@ -1039,11 +1043,8 @@ static int jtag_examine_chain(void)
break;
}
-#define EXTRACT_MFG(X) (((X) & 0xffe) >> 1)
manufacturer = EXTRACT_MFG(idcode);
-#define EXTRACT_PART(X) (((X) & 0xffff000) >> 12)
part = EXTRACT_PART(idcode);
-#define EXTRACT_VER(X) (((X) & 0xf0000000) >> 28)
version = EXTRACT_VER(idcode);
LOG_INFO("JTAG tap: %s tap/device found: 0x%8.8x (Manufacturer: 0x%3.3x, Part: 0x%4.4x, Version: 0x%1.1x)",