summaryrefslogtreecommitdiff
path: root/src/jtag
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:39:50 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:39:50 +0000
commit175867ea323137285a5389fc6a65105c06853651 (patch)
tree454437dfdaa592d7d7c01738fc94a57f4e3bad7b /src/jtag
parent92a102c2d5c59592458b5fcd23d0eeb34eb47141 (diff)
downloadopenocd+libswd-175867ea323137285a5389fc6a65105c06853651.tar.gz
openocd+libswd-175867ea323137285a5389fc6a65105c06853651.tar.bz2
openocd+libswd-175867ea323137285a5389fc6a65105c06853651.tar.xz
openocd+libswd-175867ea323137285a5389fc6a65105c06853651.zip
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
Diffstat (limited to 'src/jtag')
-rw-r--r--src/jtag/core.c13
-rw-r--r--src/jtag/jtag.h6
2 files changed, 15 insertions, 4 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 5dae1775..45ece3c4 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -63,8 +63,8 @@ const Jim_Nvp nvp_jtag_tap_event[] = {
{ .name = NULL, .value = -1 }
};
-int jtag_trst = 0;
-int jtag_srst = 0;
+static int jtag_trst = 0;
+static int jtag_srst = 0;
/**
* List all TAPs that have been created.
@@ -1250,6 +1250,15 @@ int jtag_add_statemove(tap_state_t goal_state)
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)
{
jtag_nsrst_delay = delay;
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index a3e61e3b..40639dce 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -243,8 +243,10 @@ struct jtag_tap_event_action_s
jtag_tap_event_action_t* next;
};
-extern int jtag_trst;
-extern int jtag_srst;
+/// @returns The current state of TRST.
+int jtag_get_trst(void);
+/// @returns The current state of SRST.
+int jtag_get_srst(void);
typedef struct jtag_event_callback_s
{