Properly encapsulate core hasKHZ variable.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2165 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
55be316dbf
commit
a2d18e9111
|
@ -100,13 +100,13 @@ static jtag_event_callback_t *jtag_event_callbacks;
|
||||||
/* speed in kHz*/
|
/* speed in kHz*/
|
||||||
static int speed_khz = 0;
|
static int speed_khz = 0;
|
||||||
/* flag if the kHz speed was defined */
|
/* 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;
|
struct jtag_interface_s *jtag = NULL;
|
||||||
|
|
||||||
/* configuration */
|
/* configuration */
|
||||||
jtag_interface_t *jtag_interface = NULL;
|
jtag_interface_t *jtag_interface = NULL;
|
||||||
static int jtag_speed = 0;
|
|
||||||
|
|
||||||
void jtag_set_error(int error)
|
void jtag_set_error(int error)
|
||||||
{
|
{
|
||||||
|
@ -1188,6 +1188,7 @@ int jtag_set_speed(int speed)
|
||||||
jtag_speed = speed;
|
jtag_speed = speed;
|
||||||
/* this command can be called during CONFIG,
|
/* this command can be called during CONFIG,
|
||||||
* in which case jtag isn't initialized */
|
* in which case jtag isn't initialized */
|
||||||
|
hasKHz = !jtag;
|
||||||
return jtag ? jtag->speed(speed) : ERROR_OK;
|
return jtag ? jtag->speed(speed) : ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern bool hasKHz;
|
|
||||||
|
|
||||||
extern const Jim_Nvp nvp_jtag_tap_event[];
|
extern const Jim_Nvp nvp_jtag_tap_event[];
|
||||||
|
|
||||||
/* jtag interfaces (parport, FTDI-USB, TI-USB, ...)
|
/* 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;
|
return retval;
|
||||||
}
|
}
|
||||||
cur_speed = speed_div1;
|
cur_speed = speed_div1;
|
||||||
|
|
||||||
retval = jtag_set_speed(cur_speed);
|
|
||||||
}
|
}
|
||||||
else
|
retval = jtag_set_speed(cur_speed);
|
||||||
hasKHz = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_speed = jtag_get_speed_khz();
|
cur_speed = jtag_get_speed_khz();
|
||||||
|
|
Loading…
Reference in New Issue