Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
#ifdef _DEBUG_USB_COMMS_
static void jlink_debug_buffer(uint8_t *buffer, int length);
#ifdef _DEBUG_USB_COMMS_
static void jlink_debug_buffer(uint8_t *buffer, int length);
+#else
+static inline void jlink_debug_buffer(uint8_t *buffer, int length)
+{
+}
#endif
static enum tap_state jlink_last_state = TAP_RESET;
#endif
static enum tap_state jlink_last_state = TAP_RESET;
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
DEBUG_JTAG_IO("scan input, length = %d", scan_size);
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
DEBUG_JTAG_IO("scan input, length = %d", scan_size);
-#ifdef _DEBUG_USB_COMMS_
jlink_debug_buffer(buffer, (scan_size + 7) / 8);
jlink_debug_buffer(buffer, (scan_size + 7) / 8);
type = jtag_scan_type(cmd->cmd.scan);
jlink_scan(cmd->cmd.scan->ir_scan,
type, buffer, scan_size, cmd->cmd.scan);
type = jtag_scan_type(cmd->cmd.scan);
jlink_scan(cmd->cmd.scan->ir_scan,
type, buffer, scan_size, cmd->cmd.scan);
DEBUG_JTAG_IO("pending scan result, length = %d", length);
DEBUG_JTAG_IO("pending scan result, length = %d", length);
-#ifdef _DEBUG_USB_COMMS_
jlink_debug_buffer(buffer, DIV_ROUND_UP(length, 8));
jlink_debug_buffer(buffer, DIV_ROUND_UP(length, 8));
if (jtag_read_buffer(buffer, command) != ERROR_OK)
{
if (jtag_read_buffer(buffer, command) != ERROR_OK)
{
DEBUG_JTAG_IO("jlink_usb_write, out_length = %d, result = %d",
out_length, result);
DEBUG_JTAG_IO("jlink_usb_write, out_length = %d, result = %d",
out_length, result);
-#ifdef _DEBUG_USB_COMMS_
jlink_debug_buffer(usb_out_buffer, out_length);
jlink_debug_buffer(usb_out_buffer, out_length);
DEBUG_JTAG_IO("jlink_usb_read, result = %d", result);
DEBUG_JTAG_IO("jlink_usb_read, result = %d", result);
-#ifdef _DEBUG_USB_COMMS_
jlink_debug_buffer(usb_in_buffer, result);
jlink_debug_buffer(usb_in_buffer, result);
DEBUG_JTAG_IO("jlink_usb_read_result, result = %d", result);
DEBUG_JTAG_IO("jlink_usb_read_result, result = %d", result);
-#ifdef _DEBUG_USB_COMMS_
jlink_debug_buffer(usb_emu_result_buffer, result);
jlink_debug_buffer(usb_emu_result_buffer, result);