Doxygen stuff.
[goodfet] / firmware / apps / jtag / jtag430x2.c
index b508f0b..432c725 100644 (file)
@@ -1,10 +1,6 @@
 /*! \file jtag430x2.c
   \author Travis Goodspeed <travis at radiantmachines.com>
-  
-  This is an implementation of the MSP430X2 JTAG protocol
-  for the GoodFET project at http://goodfet.sf.net/
-  
-  See the license file for details of proper use.
+  \brief MSP430X2 JTAG (20-bit)
 */
 
 #include "platform.h"
@@ -94,7 +90,7 @@ void jtag430x2_writemem(unsigned long adr,
 //! Read data from address
 unsigned int jtag430x2_readmem(unsigned long adr){
   unsigned int toret=0;
-  unsigned int tries=5;
+  //unsigned int tries=5;
   
   while(1){
     do{
@@ -201,8 +197,9 @@ void jtag430x2handle(unsigned char app,
   switch(verb){
   case START:
     //Enter JTAG mode.
-    do cmddata[0]=jtag430x2_start();
-    while(cmddata[0]==00 || cmddata[0]==0xFF);
+    //do 
+      cmddata[0]=jtag430x2_start();
+    //while(cmddata[0]==00 || cmddata[0]==0xFF);
     
     //MSP430 or MSP430X
     if(jtagid==MSP430JTAGID){ 
@@ -262,11 +259,7 @@ void jtag430x2handle(unsigned char app,
     cmddatalong[0]=jtag430_deviceid();
     txdata(app,verb,4);
     break;
-  case JTAG430_HALTCPU:
-    //jtag430x2_haltcpu();
-    break;
-  case JTAG430_RELEASECPU:
-  case JTAG430_SETINSTRFETCH:
+
   case JTAG430_WRITEMEM:
   case POKE:
     jtag430x2_writemem(cmddatalong[0],
@@ -274,9 +267,16 @@ void jtag430x2handle(unsigned char app,
     cmddataword[0]=jtag430x2_readmem(cmddatalong[0]);
     txdata(app,verb,2);
     break;
+
+    //unimplemented functions
+  case JTAG430_HALTCPU:  
+  case JTAG430_RELEASECPU:
+  case JTAG430_SETINSTRFETCH:
   case JTAG430_WRITEFLASH:
   case JTAG430_ERASEFLASH:
   case JTAG430_SETPC:
+    txdata(app,NOK,0);
+    break;
   default:
     jtaghandle(app,verb,len);
   }