]> git.zerfleddert.de Git - usb-driver/blobdiff - jtagkey.c
information for newer udev versions
[usb-driver] / jtagkey.c
index 19011fa190aff8e9f6d389fa286484cc0857c5a1..d068cf50fdd84b9d4adedd99b3ca8ef1f6128555 100644 (file)
--- a/jtagkey.c
+++ b/jtagkey.c
@@ -2,6 +2,7 @@
 #include <ftdi.h>
 #include <unistd.h>
 #include <pthread.h>
+#include <inttypes.h>
 #include "usb-driver.h"
 #include "config.h"
 #include "jtagkey.h"
@@ -108,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)
@@ -128,6 +130,7 @@ void jtagkey_state(unsigned char data) {
        
        fprintf(stderr,"\n");
 }
+#endif
 
 struct jtagkey_reader_arg {
        int             num;
@@ -209,7 +212,7 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
                        DPRINTF("write byte: %d\n", val);
 
                if (tr[i].cmdTrans == 13)
-                       tapmon(val & PP_TCK, val & PP_TMS);
+                       jtagmon(val & PP_TCK, val & PP_TMS, val & PP_TDI);
 #endif
 
                /* Pad writebuf for read-commands in stream */
@@ -290,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;
Impressum, Datenschutz