- added ft2232_latency command
authormlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 10 Sep 2007 17:07:32 +0000 (17:07 +0000)
committermlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 10 Sep 2007 17:07:32 +0000 (17:07 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@205 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/ft2232.c

index b1acee58b25a78ca4a01a7ab0d25b9e32f135494..629bab08495e4b3311629efa5cdb822029ec1849 100644 (file)
@@ -73,10 +73,12 @@ int ft2232_handle_device_desc_command(struct command_context_s *cmd_ctx, char *c
 int ft2232_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int ft2232_handle_layout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int ft2232_handle_vid_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+int ft2232_handle_latency_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 char *ft2232_device_desc = NULL;
 char *ft2232_serial = NULL;
 char *ft2232_layout = NULL;
+unsigned char ft2232_latency = 2;
 
 #define MAX_USB_IDS    8
 /* vid = pid = 0 marks the end of the list */
@@ -272,6 +274,8 @@ int ft2232_register_commands(struct command_context_s *cmd_ctx)
                COMMAND_CONFIG, NULL);
        register_command(cmd_ctx, NULL, "ft2232_vid_pid", ft2232_handle_vid_pid_command,
                                         COMMAND_CONFIG, NULL);
+       register_command(cmd_ctx, NULL, "ft2232_latency", ft2232_handle_latency_command,
+                                        COMMAND_CONFIG, NULL);
        return ERROR_OK;
 }
 
@@ -1369,7 +1373,7 @@ static int ft2232_init_ftd2xx(u16 vid, u16 pid, int more, int *try_more)
                return ERROR_JTAG_INIT_FAILED;
        }
 
-       if ((status = FT_SetLatencyTimer(ftdih, 2)) != FT_OK)
+       if ((status = FT_SetLatencyTimer(ftdih, ft2232_latency)) != FT_OK)
        {
                ERROR("unable to set latency timer: %lu", status);
                return ERROR_JTAG_INIT_FAILED;
@@ -1449,7 +1453,7 @@ static int ft2232_init_libftdi(u16 vid, u16 pid, int more, int *try_more)
                return ERROR_JTAG_INIT_FAILED;
        }
 
-       if (ftdi_set_latency_timer(&ftdic, 2) < 0)
+       if (ftdi_set_latency_timer(&ftdic, ft2232_latency) < 0)
        {
                ERROR("unable to set latency timer");
                return ERROR_JTAG_INIT_FAILED;
@@ -2039,3 +2043,18 @@ int ft2232_handle_vid_pid_command(struct command_context_s *cmd_ctx, char *cmd,
 
        return ERROR_OK;
 }
+
+int ft2232_handle_latency_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+       if (argc == 1)
+       {
+               ft2232_latency = atoi(args[0]);
+       }
+       else
+       {
+               ERROR("expected exactly one argument to ft2232_latency <ms>");
+       }
+       
+       return ERROR_OK;
+}
+

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)