From: hackbard Date: Sun, 27 Mar 2011 12:17:15 +0000 (+0200) Subject: started code to set ir ... X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73b8a3e23ea9b9760ecf1dd29170558122d1a17b;p=my-code%2Fpnx.git started code to set ir ... --- diff --git a/jtag.c b/jtag.c index ca2e683..2e8298c 100644 --- a/jtag.c +++ b/jtag.c @@ -175,6 +175,22 @@ int jtag_read_data(u8 *p,int bitlen) { } +int jtag_write_data(u8 *p,int bitlen) { + + int count; + + count=0; + + while(bitlen) { + jtag_clock(0,p[count/8]&(1<=MAXDEV*MAX_IR_LEN) { + printf("instruction register too big!\n"); + return -1; + } + + memset(ir,0,MAXDEV*MAX_IR_LEN/8*sizeof(u8)); + + while(bitlen) { + ir[count/8]|=p[count] ... HIER WEITER ..; + count+=1; + bitlen-=1; + } + + jtag_enter_shift_ir(); + + while(len--) + + jtag_leave_shift_ir(); + return 0; + +} + int main(int argc,char **argv) { t_jtag jtag;