X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/f9318fa12dd2467a2329c56f3e8930fc9670480d..4d5f52f3c64d117466aebe293dbdc6411803f87b:/jtagkey.c diff --git a/jtagkey.c b/jtagkey.c index ffae2fa..d068cf5 100644 --- a/jtagkey.c +++ b/jtagkey.c @@ -2,9 +2,11 @@ #include #include #include +#include #include "usb-driver.h" #include "config.h" #include "jtagkey.h" +#include "jtagmon.h" #define USBBUFSIZE 1048576 #define JTAG_SPEED 100000 @@ -107,7 +109,8 @@ void jtagkey_close(int handle) { } } -void jtagkey_state(unsigned char data) { +#ifdef DEBUG +static void jtagkey_state(unsigned char data) { fprintf(stderr,"Pins high: "); if (data & JTAGKEY_TCK) @@ -127,6 +130,7 @@ void jtagkey_state(unsigned char data) { fprintf(stderr,"\n"); } +#endif struct jtagkey_reader_arg { int num; @@ -206,6 +210,9 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, #ifdef DEBUG if (tr[i].cmdTrans == 13) DPRINTF("write byte: %d\n", val); + + if (tr[i].cmdTrans == 13) + jtagmon(val & PP_TCK, val & PP_TMS, val & PP_TDI); #endif /* Pad writebuf for read-commands in stream */ @@ -286,10 +293,8 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, pthread_join(reader_thread, NULL); #ifdef DEBUG - DPRINTF("write: "); - hexdump(writebuf, writepos-writebuf); - DPRINTF("read: "); - hexdump(readbuf, i); + hexdump(writebuf, writepos-writebuf, "->"); + hexdump(readbuf, i, "<-"); #endif writepos = writebuf;