cvs -z3 -q diff -u -wb (in directory U:\ISP-Programmer\avrdude-cvs\avrdude\)

Index: avrdude.conf.in
===================================================================
RCS file: /sources/avrdude/avrdude/avrdude.conf.in,v
retrieving revision 1.122
diff -u -w -b -r1.122 avrdude.conf.in
--- avrdude.conf.in	16 May 2007 21:29:36 -0000	1.122
+++ avrdude.conf.in	13 Sep 2007 21:48:50 -0000
@@ -21,6 +21,10 @@
 #                  dragon_dw | dragon_jtag | dragon_isp | dragon_pp |
 #                  dragon_hvsp; # programmer type
 #       baudrate = <num> ;                          # baudrate for avr910-programmer
+#       usbvid     = <num> ;                          # USB vendor ID
+#       usbpid     = <num> ;                          # USB product ID
+#       usbvendor  = <string> ;                       # USB optional manufacturer string
+#       usbproduct = <string> ;                       # USB optional product ID string
 #       vcc      = <num1> [, <num2> ... ] ;         # pin number(s)
 #       reset    = <num> ;                          # pin number
 #       sck      = <num> ;                          # pin number
@@ -375,6 +379,28 @@
   id    = "usbasp";
   desc  = "USBasp, http://www.fischl.de/usbasp/";
   type  = usbasp;
+  usbvid     = 0x16C0;          /* VOTI */
+  usbpid     = 0x05DC;          /* Obdev's free shared PID */
+  usbvendor  = "www.fischl.de";
+  usbproduct = "USBasp";
+;
+
+programmer
+  id    = "usbasppre";
+  desc  = "USBasp, preliminary version, http://www.fischl.de/usbasp/";
+  type  = usbasp;
+  usbvid     = 0x03EB;          /* ATMEL */
+  usbpid     = 0xC7B4;          /* (unoffical) USBasp */
+  usbvendor  = "www.fischl.de";
+  usbproduct = "USBasp";
+;
+
+programmer
+  id    = "xu1541asp";
+  desc  = "USBasp on xu1541 BIOS, http://opencbm.trikaliotis.net/";
+  type  = usbasp;
+  usbvid     = 0x0403;          /* FTDI */
+  usbpid     = 0xC632;          /* USBasp on top of XU1541 BIOS */
 ;
 
 programmer
Index: config_gram.y
===================================================================
RCS file: /sources/avrdude/avrdude/config_gram.y,v
retrieving revision 1.58
diff -u -w -b -r1.58 config_gram.y
--- config_gram.y	1 Feb 2007 22:07:39 -0000	1.58
+++ config_gram.y	13 Sep 2007 21:49:04 -0000
@@ -138,6 +138,10 @@
 %token K_USBASP
 %token K_BUTTERFLY
 %token K_TYPE
+%token K_USBPID
+%token K_USBPRODUCT
+%token K_USBVENDOR
+%token K_USBVID
 %token K_VCC
 %token K_VFYLED
 
@@ -527,6 +531,34 @@
     }
   } |
 
+  K_USBVID TKN_EQUAL TKN_NUMBER {
+    {
+      current_prog->usbvid = $3->value.number;
+    }
+  } |
+
+  K_USBPID TKN_EQUAL TKN_NUMBER {
+    {
+      current_prog->usbpid = $3->value.number;
+    }
+  } |
+
+  K_USBVENDOR TKN_EQUAL TKN_STRING {
+    {
+      strncpy(current_prog->usbvendor, $3->value.string, PGM_USBSTRINGLEN);
+      current_prog->usbvendor[PGM_USBSTRINGLEN-1] = 0;
+      free_token($3);
+    }
+  } |
+
+  K_USBPRODUCT TKN_EQUAL TKN_STRING {
+    {
+      strncpy(current_prog->usbproduct, $3->value.string, PGM_USBSTRINGLEN);
+      current_prog->usbproduct[PGM_USBSTRINGLEN-1] = 0;
+      free_token($3);
+    }
+  } |
+
   K_RESET  TKN_EQUAL TKN_NUMBER { free_token($1); 
                                   assign_pin(PIN_AVR_RESET, $3, 0); } |
   K_SCK    TKN_EQUAL TKN_NUMBER { free_token($1); 
Index: lexer.l
===================================================================
RCS file: /sources/avrdude/avrdude/lexer.l,v
retrieving revision 1.50
diff -u -w -b -r1.50 lexer.l
--- lexer.l	24 Jan 2007 22:43:46 -0000	1.50
+++ lexer.l	13 Sep 2007 21:49:07 -0000
@@ -183,6 +183,10 @@
 stk500generic    { yylval=NULL; return K_STK500GENERIC; }
 stk500_devcode   { yylval=NULL; return K_STK500_DEVCODE; }
 type             { yylval=NULL; return K_TYPE; }
+usbpid           { yylval=NULL; return K_USBPID; }
+usbproduct       { yylval=NULL; return K_USBPRODUCT; }
+usbvendor        { yylval=NULL; return K_USBVENDOR; }
+usbvid           { yylval=NULL; return K_USBVID; }
 vcc              { yylval=NULL; return K_VCC; }
 vfyled           { yylval=NULL; return K_VFYLED; }
 
Index: pgm.c
===================================================================
RCS file: /sources/avrdude/avrdude/pgm.c,v
retrieving revision 1.24
diff -u -w -b -r1.24 pgm.c
--- pgm.c	30 Jan 2007 13:41:53 -0000	1.24
+++ pgm.c	13 Sep 2007 21:48:56 -0000
@@ -82,6 +82,11 @@
   pgm->lineno = 0;
   pgm->baudrate = 0;
 
+  pgm->usbvid = 0;
+  pgm->usbpid = 0;
+  pgm->usbvendor[0] = 0;
+  pgm->usbproduct[0] = 0;
+
   for (i=0; i<N_PINS; i++)
     pgm->pinno[i] = 0;
 
Index: pgm.h
===================================================================
RCS file: /sources/avrdude/avrdude/pgm.h,v
retrieving revision 1.34
diff -u -w -b -r1.34 pgm.h
--- pgm.h	30 Jan 2007 13:41:53 -0000	1.34
+++ pgm.h	13 Sep 2007 21:49:00 -0000
@@ -35,6 +35,7 @@
 #define PGM_DESCLEN 80
 #define PGM_PORTLEN PATH_MAX
 #define PGM_TYPELEN 32
+#define PGM_USBSTRINGLEN 256
 
 typedef enum {
   EXIT_VCC_UNSPEC,
@@ -59,6 +60,8 @@
   int ppidata;
   int ppictrl;
   int baudrate;
+  int usbvid, usbpid;
+  char usbvendor[PGM_USBSTRINGLEN], usbproduct[PGM_USBSTRINGLEN];
   double bitclock;    /* JTAG ICE clock period in microseconds */
   int ispdelay;    /* ISP clock delay */
   union filedescriptor fd;
Index: usbasp.c
===================================================================
RCS file: /sources/avrdude/avrdude/usbasp.c,v
retrieving revision 1.7
diff -u -w -b -r1.7 usbasp.c
--- usbasp.c	24 Jul 2007 16:43:25 -0000	1.7
+++ usbasp.c	13 Sep 2007 21:49:13 -0000
@@ -158,28 +158,17 @@
 {
   usb_init();
 
-  if (usbOpenDevice(&usbhandle, USBASP_SHARED_VID, "www.fischl.de",
-		    USBASP_SHARED_PID, "USBasp") != 0) {
-
-    /* check if device with old VID/PID is available */
-    if (usbOpenDevice(&usbhandle, USBASP_OLD_VID, "www.fischl.de",
-		      USBASP_OLD_PID, "USBasp") != 0) {
+  char *vendorId = (pgm->usbvendor[0] == 0) ? NULL : pgm->usbvendor;
+  char *productId = (pgm->usbproduct[0] == 0) ? NULL : pgm->usbproduct;
 
+  if (usbOpenDevice(&usbhandle, pgm->usbvid, vendorId,
+		    pgm->usbpid, productId) != 0) {
       /* no USBasp found */
       fprintf(stderr,
-	      "%s: error: could not find USB device "
-	      "\"USBasp\" with vid=0x%x pid=0x%x\n",
-  	      progname, USBASP_SHARED_VID, USBASP_SHARED_PID);
+	    "%s: error: could not find USB device type "
+	    "\"USBasp\" with vid=0x%x pid=0x%x vendor=\"%s\" product=\"%s\"\n",
+  	    progname, pgm->usbvid, pgm->usbpid, pgm->usbvendor, pgm->usbproduct);
       exit(1);
-
-    } else {
-
-      /* found USBasp with old IDs */
-      fprintf(stderr,
-	      "%s: Warning: Found USB device \"USBasp\" with "
-	      "old VID/PID! Please update firmware of USBasp!\n",
-  	      progname);
-    }
   }
 
   return 0;
Index: usbasp.h
===================================================================
RCS file: /sources/avrdude/avrdude/usbasp.h,v
retrieving revision 1.4
diff -u -w -b -r1.4 usbasp.h
--- usbasp.h	24 Jul 2007 16:43:25 -0000	1.4
+++ usbasp.h	13 Sep 2007 21:49:17 -0000
@@ -24,13 +24,6 @@
 
 #include "avrpart.h"
 
-
-#define	USBASP_SHARED_VID   0x16C0  /* VOTI */
-#define	USBASP_SHARED_PID   0x05DC  /* Obdev's free shared PID */
-
-#define	USBASP_OLD_VID      0x03EB  /* ATMEL */
-#define	USBASP_OLD_PID	    0xC7B4  /* (unoffical) USBasp */
-
 #define USBASP_FUNC_CONNECT    1
 #define USBASP_FUNC_DISCONNECT 2
 #define USBASP_FUNC_TRANSMIT   3
