mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 02:31:06 +00:00
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:
15
usbtiny.c
15
usbtiny.c
@@ -37,6 +37,7 @@
|
||||
#include "pgm.h"
|
||||
#include "config.h"
|
||||
#include "usbtiny.h"
|
||||
#include "usbdevs.h"
|
||||
|
||||
#if defined(HAVE_LIBUSB) // we use LIBUSB to talk to the board
|
||||
#if defined(HAVE_USB_H)
|
||||
@@ -230,11 +231,17 @@ static int usbtiny_open(PROGRAMMER* pgm, char* name)
|
||||
vid = pgm->usbvid;
|
||||
else
|
||||
vid = USBTINY_VENDOR_DEFAULT;
|
||||
|
||||
if (pgm->usbpid)
|
||||
pid = pgm->usbpid;
|
||||
else
|
||||
|
||||
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 = USBTINY_PRODUCT_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
// now we iterate through all the busses and devices
|
||||
|
||||
Reference in New Issue
Block a user