jlink: jlink_debug_buffer use inline function when _DEBUG_USB_COMMS_ not define
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sat, 9 Apr 2011 04:21:57 +0000 (06:21 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 9 Apr 2011 08:12:08 +0000 (10:12 +0200)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
src/jtag/drivers/jlink.c

index aa5c359be10273f2463ec96ad7c04cbdafccfa1f..6eb707a1a2282cf307387bc9cee190736a058f75 100644 (file)
@@ -214,6 +214,10 @@ static int jlink_get_version_info(void);
 
 #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;
@@ -291,9 +295,7 @@ static void jlink_execute_scan(struct jtag_command *cmd)
        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);
-#endif
        type = jtag_scan_type(cmd->cmd.scan);
        jlink_scan(cmd->cmd.scan->ir_scan,
                        type, buffer, scan_size, cmd->cmd.scan);
@@ -1387,9 +1389,7 @@ static int jlink_tap_execute(void)
 
                DEBUG_JTAG_IO("pending scan result, length = %d", length);
 
-#ifdef _DEBUG_USB_COMMS_
                jlink_debug_buffer(buffer, DIV_ROUND_UP(length, 8));
-#endif
 
                if (jtag_read_buffer(buffer, command) != ERROR_OK)
                {
@@ -1609,9 +1609,7 @@ static int jlink_usb_write(struct jlink *jlink, int out_length)
        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);
-#endif
        return result;
 }
 
@@ -1623,9 +1621,7 @@ static int jlink_usb_read(struct jlink *jlink, int expected_size)
 
        DEBUG_JTAG_IO("jlink_usb_read, result = %d", result);
 
-#ifdef _DEBUG_USB_COMMS_
        jlink_debug_buffer(usb_in_buffer, result);
-#endif
        return result;
 }
 
@@ -1638,9 +1634,7 @@ static int jlink_usb_read_emu_result(struct jlink *jlink)
 
        DEBUG_JTAG_IO("jlink_usb_read_result, result = %d", result);
 
-#ifdef _DEBUG_USB_COMMS_
        jlink_debug_buffer(usb_emu_result_buffer, result);
-#endif
        return result;
 }
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)