From: oharboe at B. <oh...@ma...> - 2009-09-09 09:09:15
|
Author: oharboe Date: 2009-09-09 09:09:14 +0200 (Wed, 09 Sep 2009) New Revision: 2681 Modified: trunk/src/jtag/tcl.c Log: - Fix bug-in-waiting when adding more than one TAP event type - Infinite loop bugfix when running tap configure a second time Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-09-09 06:28:49 UTC (rev 2680) +++ trunk/src/jtag/tcl.c 2009-09-09 07:09:14 UTC (rev 2681) @@ -141,9 +141,11 @@ } 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 @@ 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 @@ * 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; } } |