From 6c8a5ae62d740c2ca0e43f985b556453911b0880 Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 28 Mar 2011 13:33:48 +0200 Subject: [PATCH] implemented set ir stuff --- jtag.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/jtag.c b/jtag.c index 2497cf7..9d05d5f 100644 --- a/jtag.c +++ b/jtag.c @@ -1,6 +1,7 @@ /* * jtag.c - basic jtag stuff (good excercise!) * + * build: gcc -Wall jtag.c -o jtag * author: hackbard@hackdaworld.org * */ @@ -164,12 +165,15 @@ int jtag_read_data(u8 *p,int bitlen) { memset(p,0,bitlen+7/8); count=0; + printf(" <- "); while(bitlen) { in=jtag_clock(0,0); p[count/8]|=((in&1)<<(count%8)); + printf("%d",p[count/8]&(1<<(count%8))?1:0); count+=1; bitlen-=1; } + printf("\n"); return 0; @@ -181,11 +185,14 @@ int jtag_write_data(u8 *p,int bitlen) { count=0; + printf(" -> "); while(bitlen) { - jtag_clock(0,p[count/8]&(1<