bit_count = 0;
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("%s num_fields: %i", cmd->ir_scan ? "IRSCAN" : "DRSCAN", cmd->num_fields);
-#endif
+ DEBUG_JTAG_IO("%s num_fields: %i",
+ cmd->ir_scan ? "IRSCAN" : "DRSCAN",
+ cmd->num_fields);
for (i = 0; i < cmd->num_fields; i++)
{
if (cmd->fields[i].out_value)
{
#ifdef _DEBUG_JTAG_IO_
- char* char_buf = buf_to_str(cmd->fields[i].out_value, (cmd->fields[i].num_bits > DEBUG_JTAG_IOZ) ? DEBUG_JTAG_IOZ : cmd->fields[i].num_bits, 16);
-#endif
- buf_set_buf(cmd->fields[i].out_value, 0, *buffer, bit_count, cmd->fields[i].num_bits);
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("fields[%i].out_value[%i]: 0x%s", i, cmd->fields[i].num_bits, char_buf);
+ char *char_buf = buf_to_str(cmd->fields[i].out_value,
+ (cmd->fields[i].num_bits > DEBUG_JTAG_IOZ)
+ ? DEBUG_JTAG_IOZ
+ : cmd->fields[i].num_bits, 16);
+
+ LOG_DEBUG("fields[%i].out_value[%i]: 0x%s", i,
+ cmd->fields[i].num_bits, char_buf);
free(char_buf);
#endif
+ buf_set_buf(cmd->fields[i].out_value, 0, *buffer,
+ bit_count, cmd->fields[i].num_bits);
}
else
{
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("fields[%i].out_value[%i]: NULL", i, cmd->fields[i].num_bits);
-#endif
+ DEBUG_JTAG_IO("fields[%i].out_value[%i]: NULL",
+ i, cmd->fields[i].num_bits);
}
bit_count += cmd->fields[i].num_bits;
}
-#ifdef _DEBUG_JTAG_IO_
- //LOG_DEBUG("bit_count totalling: %i", bit_count);
-#endif
+ //DEBUG_JTAG_IO("bit_count totalling: %i", bit_count);
return bit_count;
}
uint8_t *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits);
#ifdef _DEBUG_JTAG_IO_
- char *char_buf = buf_to_str(captured, (num_bits > DEBUG_JTAG_IOZ) ? DEBUG_JTAG_IOZ : num_bits, 16);
- LOG_DEBUG("fields[%i].in_value[%i]: 0x%s", i, num_bits, char_buf);
+ char *char_buf = buf_to_str(captured,
+ (num_bits > DEBUG_JTAG_IOZ)
+ ? DEBUG_JTAG_IOZ
+ : num_bits, 16);
+
+ LOG_DEBUG("fields[%i].in_value[%i]: 0x%s",
+ i, num_bits, char_buf);
free(char_buf);
#endif
assert(tms_count > 0);
-#if 0
- LOG_DEBUG("mpsse cmd=%02x, tms_bits = 0x%08x, bit_count=%d", mpsse_cmd, tms_bits, tms_count);
-#endif
+ DEBUG_JTAG_IO("mpsse cmd=%02x, tms_bits = 0x%08x, bit_count=%d",
+ mpsse_cmd, tms_bits, tms_count);
for (tms_byte = tms_ndx = i = 0; i < tms_count; ++i, tms_bits>>=1)
{
assert((unsigned) num_states <= 32u); /* tms_bits only holds 32 bits */
+ DEBUG_JTAG_IO("-");
+
/* this loop verifies that the path is legal and logs each state in the path */
while (num_states)
{
tms_count = 2;
/* Clock Data to TMS/CS Pin with Read */
mpsse_cmd = 0x6b;
- /* LOG_DEBUG("added TMS scan (read)"); */
}
else
{
tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
/* Clock Data to TMS/CS Pin (no Read) */
mpsse_cmd = 0x4b;
- /* LOG_DEBUG("added TMS scan (no read)"); */
}
+ DEBUG_JTAG_IO("finish %s", (type == SCAN_OUT) ? "without read" : "via PAUSE");
clock_tms(mpsse_cmd, tms_bits, tms_count, last_bit);
}
/* LOG_DEBUG("added TMS scan (no read)"); */
}
+ DEBUG_JTAG_IO("finish, %s", (type == SCAN_OUT) ? "no read" : "read");
clock_tms(mpsse_cmd, tms_bits, tms_count, last_bit);
}
}
require_send = 1;
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("runtest: %i, end in %s", cmd->cmd.runtest->num_cycles, tap_state_name(tap_get_end_state()));
-#endif
-
+ DEBUG_JTAG_IO("runtest: %i, end in %s",
+ cmd->cmd.runtest->num_cycles,
+ tap_state_name(tap_get_end_state()));
return retval;
}
int predicted_size = 0;
int retval = ERROR_OK;
- DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
+ DEBUG_JTAG_IO("statemove end in %s",
+ tap_state_name(cmd->cmd.statemove->end_state));
/* only send the maximum buffer size that FT2232C can handle */
predicted_size = 3;
require_send = 1;
if (buffer)
free(buffer);
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("%s scan, %i bits, end in %s", (cmd->cmd.scan->ir_scan) ? "IR" : "DR", scan_size,
+ DEBUG_JTAG_IO("%s scan, %i bits, end in %s",
+ (cmd->cmd.scan->ir_scan) ? "IR" : "DR", scan_size,
tap_state_name(tap_get_end_state()));
-#endif
return retval;
}
layout->reset(cmd->cmd.reset->trst, cmd->cmd.reset->srst);
require_send = 1;
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("trst: %i, srst: %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst);
-#endif
+ DEBUG_JTAG_IO("trst: %i, srst: %i",
+ cmd->cmd.reset->trst, cmd->cmd.reset->srst);
return retval;
}
retval = ERROR_JTAG_QUEUE_FAILED;
first_unsent = cmd->next;
jtag_sleep(cmd->cmd.sleep->us);
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("sleep %i usec while in %s", cmd->cmd.sleep->us, tap_state_name(tap_get_state()));
-#endif
-
+ DEBUG_JTAG_IO("sleep %i usec while in %s",
+ cmd->cmd.sleep->us,
+ tap_state_name(tap_get_state()));
return retval;
}
*/
if (ft2232_stableclocks(cmd->cmd.stableclocks->num_cycles, cmd) != ERROR_OK)
retval = ERROR_JTAG_QUEUE_FAILED;
-#ifdef _DEBUG_JTAG_IO_
- LOG_DEBUG("clocks %i while in %s", cmd->cmd.stableclocks->num_cycles, tap_state_name(tap_get_state()));
-#endif
-
+ DEBUG_JTAG_IO("clocks %i while in %s",
+ cmd->cmd.stableclocks->num_cycles,
+ tap_state_name(tap_get_state()));
return retval;
}