Encapsulate the jtag_trst and jtag_srst variables:
- Add accessor functions to return their value. - Use new SRST accessor in cortex_m3.c and mips_m4k.c git-svn-id: svn://svn.berlios.de/openocd/trunk@2157 b42882b7-edfa-0310-969c-e2dbd0fdcd60__archive__
parent
92a102c2d5
commit
175867ea32
|
@ -63,8 +63,8 @@ const Jim_Nvp nvp_jtag_tap_event[] = {
|
||||||
{ .name = NULL, .value = -1 }
|
{ .name = NULL, .value = -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int jtag_trst = 0;
|
static int jtag_trst = 0;
|
||||||
int jtag_srst = 0;
|
static int jtag_srst = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List all TAPs that have been created.
|
* List all TAPs that have been created.
|
||||||
|
@ -1250,6 +1250,15 @@ int jtag_add_statemove(tap_state_t goal_state)
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int jtag_get_trst(void)
|
||||||
|
{
|
||||||
|
return jtag_trst;
|
||||||
|
}
|
||||||
|
int jtag_get_srst(void)
|
||||||
|
{
|
||||||
|
return jtag_srst;
|
||||||
|
}
|
||||||
|
|
||||||
void jtag_set_nsrst_delay(unsigned delay)
|
void jtag_set_nsrst_delay(unsigned delay)
|
||||||
{
|
{
|
||||||
jtag_nsrst_delay = delay;
|
jtag_nsrst_delay = delay;
|
||||||
|
|
|
@ -243,8 +243,10 @@ struct jtag_tap_event_action_s
|
||||||
jtag_tap_event_action_t* next;
|
jtag_tap_event_action_t* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int jtag_trst;
|
/// @returns The current state of TRST.
|
||||||
extern int jtag_srst;
|
int jtag_get_trst(void);
|
||||||
|
/// @returns The current state of SRST.
|
||||||
|
int jtag_get_srst(void);
|
||||||
|
|
||||||
typedef struct jtag_event_callback_s
|
typedef struct jtag_event_callback_s
|
||||||
{
|
{
|
||||||
|
|
|
@ -544,7 +544,7 @@ int cortex_m3_halt(target_t *target)
|
||||||
|
|
||||||
if (target->state == TARGET_RESET)
|
if (target->state == TARGET_RESET)
|
||||||
{
|
{
|
||||||
if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_srst)
|
if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst())
|
||||||
{
|
{
|
||||||
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
|
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
|
||||||
return ERROR_TARGET_FAILURE;
|
return ERROR_TARGET_FAILURE;
|
||||||
|
|
|
@ -235,7 +235,7 @@ int mips_m4k_halt(struct target_s *target)
|
||||||
|
|
||||||
if (target->state == TARGET_RESET)
|
if (target->state == TARGET_RESET)
|
||||||
{
|
{
|
||||||
if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_srst)
|
if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst())
|
||||||
{
|
{
|
||||||
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
|
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
|
||||||
return ERROR_TARGET_FAILURE;
|
return ERROR_TARGET_FAILURE;
|
||||||
|
|
Loading…
Reference in New Issue