mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 18:44:17 +00:00
Change the second parameter of the ser_open method from "baud" into a
"union pinfo", so the USB parameters can be passed without hacks. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1276 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
70
jtagmkII.c
70
jtagmkII.c
@@ -1541,7 +1541,7 @@ static int jtagmkII_parseextparms(PROGRAMMER * pgm, LISTID extparms)
|
||||
|
||||
static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_open()\n", progname);
|
||||
@@ -1552,7 +1552,7 @@ static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1563,7 +1563,9 @@ static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_JTAGICEMKII;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_JTAGICEMKII;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1575,7 +1577,7 @@ static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1592,7 +1594,7 @@ static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
|
||||
static int jtagmkII_open_dw(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_open_dw()\n", progname);
|
||||
@@ -1603,7 +1605,7 @@ static int jtagmkII_open_dw(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1614,7 +1616,9 @@ static int jtagmkII_open_dw(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_JTAGICEMKII;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_JTAGICEMKII;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1626,7 +1630,7 @@ static int jtagmkII_open_dw(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1643,7 +1647,7 @@ static int jtagmkII_open_dw(PROGRAMMER * pgm, char * port)
|
||||
|
||||
static int jtagmkII_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_open_pdi()\n", progname);
|
||||
@@ -1654,7 +1658,7 @@ static int jtagmkII_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1665,7 +1669,9 @@ static int jtagmkII_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_JTAGICEMKII;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_JTAGICEMKII;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1677,7 +1683,7 @@ static int jtagmkII_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1695,7 +1701,7 @@ static int jtagmkII_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
|
||||
static int jtagmkII_dragon_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_dragon_open()\n", progname);
|
||||
@@ -1706,7 +1712,7 @@ static int jtagmkII_dragon_open(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1717,7 +1723,9 @@ static int jtagmkII_dragon_open(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_AVRDRAGON;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_AVRDRAGON;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1729,7 +1737,7 @@ static int jtagmkII_dragon_open(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1747,7 +1755,7 @@ static int jtagmkII_dragon_open(PROGRAMMER * pgm, char * port)
|
||||
|
||||
static int jtagmkII_dragon_open_dw(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_dragon_open_dw()\n", progname);
|
||||
@@ -1758,7 +1766,7 @@ static int jtagmkII_dragon_open_dw(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1769,7 +1777,9 @@ static int jtagmkII_dragon_open_dw(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_AVRDRAGON;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_AVRDRAGON;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1781,7 +1791,7 @@ static int jtagmkII_dragon_open_dw(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1799,7 +1809,7 @@ static int jtagmkII_dragon_open_dw(PROGRAMMER * pgm, char * port)
|
||||
|
||||
static int jtagmkII_dragon_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_dragon_open_pdi()\n", progname);
|
||||
@@ -1810,7 +1820,7 @@ static int jtagmkII_dragon_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -1821,7 +1831,9 @@ static int jtagmkII_dragon_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_AVRDRAGON;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_AVRDRAGON;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -1833,7 +1845,7 @@ static int jtagmkII_dragon_open_pdi(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3438,7 +3450,7 @@ static int jtagmkII_open32(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
int status;
|
||||
unsigned char buf[6], *resp;
|
||||
long baud;
|
||||
union pinfo pinfo;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_open32()\n", progname);
|
||||
@@ -3449,7 +3461,7 @@ static int jtagmkII_open32(PROGRAMMER * pgm, char * port)
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
baud = 19200;
|
||||
pinfo.baud = 19200;
|
||||
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
@@ -3460,7 +3472,9 @@ static int jtagmkII_open32(PROGRAMMER * pgm, char * port)
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
#if defined(HAVE_LIBUSB)
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_JTAGICEMKII;
|
||||
pinfo.usbinfo.vid = USB_VENDOR_ATMEL;
|
||||
pinfo.usbinfo.flags = 0;
|
||||
pinfo.usbinfo.pid = USB_DEVICE_JTAGICEMKII;
|
||||
pgm->fd.usb.max_xfer = USBDEV_MAX_XFER_MKII;
|
||||
pgm->fd.usb.rep = USBDEV_BULK_EP_READ_MKII;
|
||||
pgm->fd.usb.wep = USBDEV_BULK_EP_WRITE_MKII;
|
||||
@@ -3472,7 +3486,7 @@ static int jtagmkII_open32(PROGRAMMER * pgm, char * port)
|
||||
}
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
if (serial_open(port, baud, &pgm->fd)==-1) {
|
||||
if (serial_open(port, pinfo, &pgm->fd)==-1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user