Properly encapsulate core hasKHZ variable.
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 9 Jun 2009 08:41:08 +0000 (08:41 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 9 Jun 2009 08:41:08 +0000 (08:41 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2165 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/core.c
src/jtag/tcl.c

index 165e19662b278136df7733fbab005a8d5320d4f8..d838e29b0b8320869728c7c823eca84bd8b6e0b5 100644 (file)
@@ -100,13 +100,13 @@ static jtag_event_callback_t *jtag_event_callbacks;
 /* speed in kHz*/
 static int speed_khz = 0;
 /* flag if the kHz speed was defined */
-bool hasKHz = false;
+static bool hasKHz = false;
+static int jtag_speed = 0;
 
 struct jtag_interface_s *jtag = NULL;
 
 /* configuration */
 jtag_interface_t *jtag_interface = NULL;
-static int jtag_speed = 0;
 
 void jtag_set_error(int error)
 {
@@ -1188,6 +1188,7 @@ int jtag_set_speed(int speed)
        jtag_speed = speed;
        /* this command can be called during CONFIG,
         * in which case jtag isn't initialized */
+       hasKHz = !jtag;
        return jtag ? jtag->speed(speed) : ERROR_OK;
 }
 
index 1ec307abf1b477536fb65b9b81e5bfe21ebfe0c2..99ed1a3682e0def386f03a5ca5af7b542b7b6a9a 100644 (file)
@@ -39,8 +39,6 @@
 #include <strings.h>
 #endif
 
-extern bool hasKHz;
-
 extern const Jim_Nvp nvp_jtag_tap_event[];
 
 /* jtag interfaces (parport, FTDI-USB, TI-USB, ...)
@@ -994,11 +992,8 @@ static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd,
                                return retval;
                        }
                        cur_speed = speed_div1;
-
-                       retval = jtag_set_speed(cur_speed);
                }
-               else
-                       hasKHz = true;
+               retval = jtag_set_speed(cur_speed);
        }
 
        cur_speed = jtag_get_speed_khz();

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)