]>
cvs.zerfleddert.de Git - usb-driver/blob - jtagmon.c
24 void jtagmon(unsigned char tck
, unsigned char tms
, unsigned char tdi
) {
25 static unsigned char last_tck
= 1;
26 static char tdi_written
= 0;
27 static int state
= TEST_LOGIC_RESET
;
28 static char state_text
[32] = "Test Logic Reset";
29 char last_state_text
[32];
30 int last_state
= state
;
32 strcpy(last_state_text
, state_text
);
34 if (!last_tck
&& tck
) {
36 case TEST_LOGIC_RESET
:
38 state
= TEST_LOGIC_RESET
;
40 state
= RUN_TEST_IDLE
;
47 state
= RUN_TEST_IDLE
;
96 state
= RUN_TEST_IDLE
;
101 state
= TEST_LOGIC_RESET
;
145 state
= RUN_TEST_IDLE
;
151 case TEST_LOGIC_RESET
:
152 strcpy(state_text
, "Test Logic Reset");
155 strcpy(state_text
, "Run-Test / Idle");
158 strcpy(state_text
, "Select-DR");
161 strcpy(state_text
, "Capture-DR");
164 strcpy(state_text
, "Shift-DR");
167 strcpy(state_text
, "Exit1-DR");
170 strcpy(state_text
, "Pause-DR");
173 strcpy(state_text
, "Exit2-DR");
176 strcpy(state_text
, "Update-DR");
179 strcpy(state_text
, "Select-IR");
182 strcpy(state_text
, "Capture-IR");
185 strcpy(state_text
, "Shift-IR");
188 strcpy(state_text
, "Exit1-IR");
191 strcpy(state_text
, "Pause-IR");
194 strcpy(state_text
, "Exit2-IR");
197 strcpy(state_text
, "Update-IR");
201 if (last_state
!= state
) {
203 fprintf(stderr
,"\n");
205 fprintf(stderr
,"TAP state transition from %s to %s\n", last_state_text
, state_text
);
208 fprintf(stderr
,"%d",(tdi
? 1 : 0));