Zach Welch <zw@superlucidity.net> add TAP_SCAN_BYTES macro (1 of 2)

git-svn-id: svn://svn.berlios.de/openocd/trunk@1524 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
oharboe 2009-04-24 16:24:55 +00:00
parent 002fdcf016
commit 447a615dc3
2 changed files with 4 additions and 1 deletions

View File

@ -672,7 +672,7 @@ static int jlink_tap_execute(void)
return ERROR_OK;
// number of full bytes (plus one if some would be left over)
byte_length = tap_length / 8 + !!(tap_length % 8);
byte_length = TAP_SCAN_BYTES(tap_length);
usb_out_buffer[0] = EMU_CMD_HW_JTAG3;
usb_out_buffer[1] = 0;

View File

@ -217,6 +217,9 @@ typedef void* error_handler_t; /* Later on we can delete error_handler_t, but k
struct scan_field_s;
typedef int (*in_handler_t)(u8* in_value, void* priv, struct scan_field_s* field);
/// @brief calculates number of bytes required to hold @a n TAP scan bits
#define TAP_SCAN_BYTES(n) (((n) / 8) + !!((n) % 8))
typedef struct scan_field_s
{
jtag_tap_t* tap; /* tap pointer this instruction refers to */