summaryrefslogtreecommitdiff
path: root/src/jtag/tcl.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-09-09 07:09:14 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-09-09 07:09:14 +0000
commit983f5a1ae932d40109031cfec8162f820cfc6f39 (patch)
treeb7e6b46da9787e52ae34767d372d18671891b69e /src/jtag/tcl.c
parentaa46b1537792688510717cbbc215da160c2cb665 (diff)
downloadopenocd+libswd-983f5a1ae932d40109031cfec8162f820cfc6f39.tar.gz
openocd+libswd-983f5a1ae932d40109031cfec8162f820cfc6f39.tar.bz2
openocd+libswd-983f5a1ae932d40109031cfec8162f820cfc6f39.tar.xz
openocd+libswd-983f5a1ae932d40109031cfec8162f820cfc6f39.zip
- Fix bug-in-waiting when adding more than one TAP event type
- Infinite loop bugfix when running tap configure a second time git-svn-id: svn://svn.berlios.de/openocd/trunk@2681 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/tcl.c')
-rw-r--r--src/jtag/tcl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index defd6ef3..f81b6829 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -141,9 +141,11 @@ static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, jtag_tap_t * tap)
}
if (goi->isconfigure) {
+ bool replace = true;
if (jteap == NULL) {
/* create new */
jteap = calloc(1, sizeof (*jteap));
+ replace = false;
}
jteap->event = n->value;
Jim_GetOpt_Obj(goi, &o);
@@ -153,9 +155,12 @@ static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, jtag_tap_t * tap)
jteap->body = Jim_DuplicateObj(goi->interp, o);
Jim_IncrRefCount(jteap->body);
- /* add to head of event list */
- jteap->next = tap->event_action;
- tap->event_action = jteap;
+ if (!replace)
+ {
+ /* add to head of event list */
+ jteap->next = tap->event_action;
+ tap->event_action = jteap;
+ }
Jim_SetEmptyResult(goi->interp);
} else {
/* get */
@@ -374,7 +379,8 @@ static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e)
* can't fail. That presumes later code
* will be verifying the scan chains ...
*/
- tap->enabled = (e == JTAG_TAP_EVENT_ENABLE);
+ if (e == JTAG_TAP_EVENT_ENABLE)
+ tap->enabled = true;
}
}