Index: trunk/FirmwareFX2/usbjtag.c
===================================================================
--- trunk/FirmwareFX2/usbjtag.c	(revision 104)
+++ trunk/FirmwareFX2/usbjtag.c	(revision 135)
@@ -34,6 +34,4 @@
 #include "hardware.h"
 
-#include "spi.h"
-
 //-----------------------------------------------------------------------------
 // Define USE_MOD256_OUTBUFFER:
@@ -136,16 +134,15 @@
    EP8FIFOCFG = bmAUTOIN; SYNCDELAY;                    // Endpoint 8 used for user communication, auto commitment, 8 bits data bus
 
-   EP8AUTOINLENH = 0x00; SYNCDELAY;                     // Size in bytes of the IN data automatically commited (64 bytes here, but changed dynamically depending on the connection)
-   EP8AUTOINLENL = 0x40; SYNCDELAY;                     // Can use signal PKTEND if you want to commit a shorter packet
+   EP8AUTOINLENH = 0x02; SYNCDELAY;                     // Size in bytes of the IN data automatically commited (512 bytes here, but changed dynamically depending on the connection)
+   EP8AUTOINLENL = 0x00; SYNCDELAY;                     // Can use signal PKTEND if you want to commit a shorter packet
 
    // Out endpoints do not come up armed
    // Since the defaults are double buffered we must write dummy byte counts twice
-   EP2BCL = 0x80; SYNCDELAY;                            // Arm EP2OUT by writing byte count w/skip.=
+   EP2BCL = 0x80; SYNCDELAY;                            // Arm EP2OUT by writing byte count w/skip.
    EP4BCL = 0x80; SYNCDELAY;
-   EP2BCL = 0x80; SYNCDELAY;                            // Arm EP4OUT by writing byte count w/skip.=
+   EP2BCL = 0x80; SYNCDELAY;                            // Arm EP4OUT by writing byte count w/skip.
    EP4BCL = 0x80; SYNCDELAY;
 
    PINFLAGSAB = 0xFA; SYNCDELAY;                        // 1111_1010 => FLAGA = EMPTY flag for EP6; FLAGB = FULL flag for EP8
-
 
    // LED turned off by default
@@ -370,17 +367,4 @@
     }
 
-    if (bRequest == VEN_SPI_WR) // 0x99
-    {
-      // get EP0 data
-      EP0BCL = 0;               // arm EP0 for OUT xfer.  This sets the busy bit
-
-      while (EP0CS & bmEPBUSY)  // wait for busy to clear
-        ;
-
-      //                 head_hi, head_l , format , address, *buf  , len
-      return !spi_write (wValueH, wValueL, wIndexH, wIndexL, EP0BUF, EP0BCL);
-    }
-
-
     return 1;
   }
@@ -388,68 +372,4 @@
   // IN requests.
 
-  // change USB speed
-  if (bRequest == 0x91)
-  {
-    if (wIndexL == 0)                // high speed
-    {
-      CT1 &= ~0x02;
-      fx2_renumerate();              // renumerate
-    }
-    else                             // full speed
-    {
-      CT1 |= 0x02;
-      fx2_renumerate();              // renumerate
-    }   
-  }
-  
-  // change synchronous/asynchronous mode
-  if (bRequest == 0x92)
-  {
-    if(IFCONFIG & bmASYNC)
-    {
-      IFCONFIG &= ~bmASYNC;
-    }
-    else
-    {
-      IFCONFIG |= bmASYNC;
-    }
-  }
-
-  if (bRequest == 0x93) // change to synchronous mode
-  {
-    IFCONFIG &= ~bmASYNC;
-  }
-  
-  if (bRequest == VEN_SPI_EN) // 0x96
-  {
-    SPI_OE |= bmSPI_OE; // PA.0,1,3,7 output enable
-    init_spi();
-    EP0BUF[0] = 0;
-    EP0BUF[1] = 0;
-  }
-  
-  if (bRequest == VEN_SPI_DIS) // 0x97
-  {
-    SPI_OE &= ~bmSPI_OE; // PA.0,1,3,7 output disable
-    EP0BUF[0] = 0x42;
-    EP0BUF[1] = 0x43;
-    EP0BUF[2] = 0x42;
-    EP0BUF[3] = 0x43;
-    EP0BCH = 0;
-    EP0BCL = wLengthL;
-    return 1;
-  }
-  
-  if (bRequest == VEN_SPI_RD) // 0x98
-  {
-    //            header_H,header_L, format, address, *buf  , len
-    if (spi_read (wValueH, wValueL, wIndexH, wIndexL, EP0BUF, wLengthL))
-      return 0;
-  
-    EP0BCH = 0;
-    EP0BCL = wLengthL;
-    return 1;
-  }
-  
   if(bRequest == 0x90)
   {
