target: use consistent halt timeout
[openocd.git] / src / target / target.c
index 464954141e35baa7df04ec4e63156b3a4840ea12..60a8a773909129edf126abd8546a4b36c9265b75 100644 (file)
@@ -56,6 +56,9 @@
 #include "image.h"
 #include "rtos/rtos.h"
 
+/* default halt wait timeout (ms) */
+#define DEFAULT_HALT_TIMEOUT 5000
+
 static int target_read_buffer_default(struct target *target, uint32_t address,
                uint32_t size, uint8_t *buffer);
 static int target_write_buffer_default(struct target *target, uint32_t address,
@@ -456,7 +459,7 @@ int target_poll(struct target *target)
                        target->halt_issued = false;
                else {
                        long long t = timeval_ms() - target->halt_issued_time;
-                       if (t > 1000) {
+                       if (t > DEFAULT_HALT_TIMEOUT) {
                                target->halt_issued = false;
                                LOG_INFO("Halt timed out, wake up GDB.");
                                target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
@@ -2409,7 +2412,7 @@ COMMAND_HANDLER(handle_wait_halt_command)
        if (CMD_ARGC > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       unsigned ms = 5000;
+       unsigned ms = DEFAULT_HALT_TIMEOUT;
        if (1 == CMD_ARGC) {
                int retval = parse_uint(CMD_ARGV[0], &ms);
                if (ERROR_OK != retval)
@@ -5022,7 +5025,7 @@ static int target_create(Jim_GetOptInfo *goi)
        }
 
        /* now - create the new target name command */
-       const const struct command_registration target_subcommands[] = {
+       const struct command_registration target_subcommands[] = {
                {
                        .chain = target_instance_command_handlers,
                },
@@ -5031,7 +5034,7 @@ static int target_create(Jim_GetOptInfo *goi)
                },
                COMMAND_REGISTRATION_DONE
        };
-       const const struct command_registration target_commands[] = {
+       const struct command_registration target_commands[] = {
                {
                        .name = cp,
                        .mode = COMMAND_ANY,

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)