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
__archive__
zwelch 2009-06-07 05:22:09 +00:00
parent 43e1ed244f
commit 0b08845e3f
1 changed files with 4 additions and 3 deletions

View File

@ -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)",