Turn the usbpid parameter of the programmer into a list of PIDs. Make

the JTAGICE3 programmer handle a list of PIDs, by trying each of them
in sequence.  Use a single, central jtag3_open_common() function to
handle the common code of all jtag3_open_* functions.  Centralize all
USB VID/PID definitions in usbdevs.h.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1283 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2014-02-27 13:06:03 +00:00
parent 0ca7d30267
commit 343330fddd
19 changed files with 223 additions and 233 deletions

View File

@@ -41,6 +41,7 @@
#include "avrpart.h"
#include "avrftdi_tpi.h"
#include "avrftdi_private.h"
#include "usbdevs.h"
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
@@ -666,12 +667,17 @@ static int avrftdi_open(PROGRAMMER * pgm, char *port)
if (pgm->usbvid)
vid = pgm->usbvid;
else
vid = 0x0403;
vid = USB_VENDOR_FTDI;
if (pgm->usbpid)
pid = pgm->usbpid;
else
pid = 0x6010;
LNODEID usbpid = lfirst(pgm->usbpid);
if (usbpid) {
pid = *(int *)(ldata(usbpid));
if (lnext(usbpid))
fprintf(stderr,
"%s: Warning: using PID 0x%04x, ignoring remaining PIDs in list\n",
progname, pid);
} else
pid = USB_DEVICE_FT2232;
if (0 == pgm->usbsn[0]) /* we don't care about SN. Use first avail. */
serial = NULL;