From 0b08845e3fdd79c1ddf0ed3e98623eaff5f65188 Mon Sep 17 00:00:00 2001 From: zwelch Date: Sun, 7 Jun 2009 05:22:09 +0000 Subject: 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 --- src/jtag/jtag.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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)", -- cgit v1.2.3