Index: trunk/FirmwareFX2/usbjtag.c
===================================================================
--- trunk/FirmwareFX2/usbjtag.c	(revision 20)
+++ trunk/FirmwareFX2/usbjtag.c	(revision 21)
@@ -94,4 +94,5 @@
 
    // Make Timer2 reload at 100 Hz to trigger Keepalive packets
+
    tmp = 65536 - ( 48000000 / 12 / 100 );
    RCAP2H = tmp >> 8;
@@ -101,7 +102,8 @@
 
    // Enable Autopointer
-   EXTACC = 1;          // Enable
-   APTR1FZ = 1;         // Don't freeze
-   APTR2FZ = 1;         // Don't freeze
+
+   EXTACC = 1;                                          // Enable
+   APTR1FZ = 1;                                         // Don't freeze
+   APTR2FZ = 1;                                         // Don't freeze
 
    // define endpoint configuration
@@ -128,9 +130,9 @@
    EP6CFG     = 0xA2; SYNCDELAY;                        // Out endpoint, Bulk, Double buffering
    EP6FIFOCFG = 0x00; SYNCDELAY;                        // Firmware has to see a rising edge on auto bit to enable auto arming
-   EP6FIFOCFG = bmAUTOOUT | bmWORDWIDE; SYNCDELAY;      // Endpoint 6 used for user communicationn, auto commitment, 16 bits data bus
+   EP6FIFOCFG = bmAUTOOUT; SYNCDELAY;                   // Endpoint 6 used for user communicationn, auto commitment, 8 bits data bus
 
    EP8CFG     = 0xE0; SYNCDELAY;                        // In endpoint, Bulk
    EP8FIFOCFG = 0x00; SYNCDELAY;                        // Firmware has to see a rising edge on auto bit to enable auto arming
-   EP8FIFOCFG = bmAUTOIN  | bmWORDWIDE; SYNCDELAY;      // Endpoint 8 used for user communication, auto commitment, 16 bits data bus
+   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)
@@ -143,8 +145,5 @@
    EP2BCL = 0x80; SYNCDELAY;                            // Arm EP4OUT by writing byte count w/skip.=
    EP4BCL = 0x80; SYNCDELAY;
-   
-   // JTAG from FX2 enabled by default
-   IOC |= (1 << 7);
-   
+
    // Put the system in high speed by default (REM: USB-Blaster is in full speed)
    // This can be changed by vendor commands
@@ -398,18 +397,6 @@
   }
   
-  // change JTAG enable
+  // change synchronous/asynchronous mode
   if (bRequest == 0x92)
-  {
-    if (wIndexL == 0)                  // FX2 is master of JTAG
-    {
-      IOC |= (1 << 7);
-    }
-    else                               // external connector is master of JTAG
-    {
-      IOC &= ~(1 << 7);
-    }
-  }
-  // change synchronous/asynchronous mode
-  if (bRequest == 0x93)
   {
     if(IFCONFIG & bmASYNC)
@@ -422,6 +409,6 @@
     }
   }
-  
-  if (bRequest == 0x94) // change to synchronous mode
+
+  if (bRequest == 0x93) // change to synchronous mode
   {
     IFCONFIG &= ~bmASYNC;
@@ -445,5 +432,4 @@
     EP0BCH = 0;
     EP0BCL = wLengthL;
-//    EP0CS |= bmHSNAK; // Bram
     return 1;
   }
@@ -460,31 +446,4 @@
   }
   
-  if (bRequest == 0x95) // For debugging purposes
-  {
-  
-    SPI &= ~bmSS; // enable slave select
-
-    spi_write_byte_msb(wValueL); // address
-    spi_write_byte_msb(wIndexL); // header
-    EP0BUF[0] = spi_read_byte_msb(); // read back value from slave
-    
-    SPI |= bmSS; /* active low, disable slave */
-    
-    EP0BCH = 0;
-    EP0BCL = 1; // Arm the EP
-    return 1;
-
-    /*static xdata unsigned char buf[2];
-    buf[0] = 0xFF;
-    buf[1] = 0x10;
-    spi_read(0x00, wValueL, SPI_FMT_HDR_1, wValueH, buf, 0);
-    //spi_write_byte_msb(wValueL);
-    EP0BUF[0] = 0x51;
-    EP0BUF[1] = wValueL;
-    EP0BCH = 0;
-    EP0BCL = wLengthL;
-    return 1;*/
-  }
-
   if(bRequest == 0x90)
   {
@@ -502,5 +461,4 @@
   EP0BCH = 0;
   EP0BCL = (wLengthL<2) ? wLengthL : 2; // Arm endpoint with # bytes to transfer
-  //EP0CS |= bmHSNAK; // Bram
 
   return 1;
@@ -526,6 +484,6 @@
   usb_jtag_init();
   eeprom_init();
-  setup_autovectors ();
-  usb_install_handlers ();
+  setup_autovectors();
+  usb_install_handlers();
 
 
