summaryrefslogtreecommitdiff
path: root/src/jtag/core.c
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:41:08 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:41:08 +0000
commita2d18e9111d3bd9a504e15b16a5d8b4bdbded29b (patch)
treee07bc873c1b6b410c3a542b0566a4de2f045471d /src/jtag/core.c
parent55be316dbf13dcb1cc54c41330ac37960e82630e (diff)
downloadopenocd+libswd-a2d18e9111d3bd9a504e15b16a5d8b4bdbded29b.tar.gz
openocd+libswd-a2d18e9111d3bd9a504e15b16a5d8b4bdbded29b.tar.bz2
openocd+libswd-a2d18e9111d3bd9a504e15b16a5d8b4bdbded29b.tar.xz
openocd+libswd-a2d18e9111d3bd9a504e15b16a5d8b4bdbded29b.zip
Properly encapsulate core hasKHZ variable.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2165 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r--src/jtag/core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 165e1966..d838e29b 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -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;
}