mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-15 02:01:07 +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:
16
ft245r.c
16
ft245r.c
@@ -68,6 +68,7 @@
|
||||
#include "config.h"
|
||||
#include "bitbang.h"
|
||||
#include "ft245r.h"
|
||||
#include "usbdevs.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
@@ -557,9 +558,20 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
|
||||
|
||||
handle = malloc (sizeof (struct ftdi_context));
|
||||
ftdi_init(handle);
|
||||
LNODEID usbpid = lfirst(pgm->usbpid);
|
||||
int pid;
|
||||
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_FT245;
|
||||
}
|
||||
rv = ftdi_usb_open_desc_index(handle,
|
||||
pgm->usbvid?pgm->usbvid:0x0403,
|
||||
pgm->usbpid?pgm->usbpid:0x6001,
|
||||
pgm->usbvid?pgm->usbvid:USB_VENDOR_FTDI,
|
||||
pid,
|
||||
pgm->usbproduct[0]?pgm->usbproduct:NULL,
|
||||
pgm->usbsn[0]?pgm->usbsn:NULL,
|
||||
devnum);
|
||||
|
||||
Reference in New Issue
Block a user