Cleaning MSP430X2 client.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 3 Feb 2011 23:28:26 +0000 (23:28 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 3 Feb 2011 23:28:26 +0000 (23:28 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@879 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/jtag/jtag430x2.c

index 265dae0..16eeb94 100644 (file)
@@ -81,20 +81,16 @@ unsigned int jtag430x2_readmem(unsigned long adr){
   //unsigned int tries=5;
   
   while(1){
   //unsigned int tries=5;
   
   while(1){
-    //do{
-    jtag_ir_shift8(IR_CNTRL_SIG_CAPTURE);
-    //}while(!(jtag_dr_shift16(0) & 0x0301));
+    do{
+      jtag_ir_shift8(IR_CNTRL_SIG_CAPTURE);
+    }while(!(jtag_dr_shift16(0) & 0x0301));
     
     if(jtag_dr_shift16(0) & 0x0301){
       // Read Memory
       CLRTCLK;
       jtag_ir_shift8(IR_CNTRL_SIG_16BIT);
       
     
     if(jtag_dr_shift16(0) & 0x0301){
       // Read Memory
       CLRTCLK;
       jtag_ir_shift8(IR_CNTRL_SIG_16BIT);
       
-      //if(adr>=0x100){
       jtag_dr_shift16(0x0501);//word read
       jtag_dr_shift16(0x0501);//word read
-      //}else{
-      //jtag_dr_shift16(0x0511);//byte read
-      //}
       
       jtag_ir_shift8(IR_ADDR_16BIT);
       jtag_dr_shift20(adr); //20
       
       jtag_ir_shift8(IR_ADDR_16BIT);
       jtag_dr_shift20(adr); //20
@@ -111,6 +107,8 @@ unsigned int jtag430x2_readmem(unsigned long adr){
       SETTCLK;
       return toret;
     }
       SETTCLK;
       return toret;
     }
+    
+    return 0xdead;
   }
   //return toret;
 }
   }
   //return toret;
 }
@@ -119,7 +117,7 @@ unsigned int jtag430x2_readmem(unsigned long adr){
 unsigned int jtag430x2_syncpor(){
   jtag_ir_shift8(IR_CNTRL_SIG_16BIT);
   jtag_dr_shift16(0x1501); //JTAG mode
 unsigned int jtag430x2_syncpor(){
   jtag_ir_shift8(IR_CNTRL_SIG_16BIT);
   jtag_dr_shift16(0x1501); //JTAG mode
-  while(!(jtag_dr_shift16(0) & 0x200));
+  while(!(jtag_dr_shift16(0) & 0x200));  //0x100 or 0x200?
   return jtag430x2_por();
 }
 
   return jtag430x2_por();
 }
 
@@ -229,6 +227,8 @@ void jtag430x2_handle_fn( uint8_t const app,
       return;
     }
     
       return;
     }
     
+    
+    
     jtag430x2_fusecheck();
         
     jtag430x2_syncpor();
     jtag430x2_fusecheck();
         
     jtag430x2_syncpor();