Submitted by <eolson@mit.edu>:

* stk500v2.c (stk500v2_open): patch #5273: Emit error message
if user requests usb and no libusb support


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@608 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2006-08-14 21:30:04 +00:00
parent afacd180eb
commit a1e7b43de4
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-08-14 Joerg Wunsch <j@uriah.heep.sax.de>
Submitted by <eolson@mit.edu>:
* stk500v2.c (stk500v2_open): patch #5273: Emit error message
if user requests usb and no libusb support
2006-08-14 Joerg Wunsch <j@uriah.heep.sax.de> 2006-08-14 Joerg Wunsch <j@uriah.heep.sax.de>
* avrdude.conf.in: Add HVSP/PP mode parameters for all AVRs. * avrdude.conf.in: Add HVSP/PP mode parameters for all AVRs.

View File

@ -732,7 +732,6 @@ static int stk500v2_open(PROGRAMMER * pgm, char * port)
if (pgm->baudrate) if (pgm->baudrate)
baud = pgm->baudrate; baud = pgm->baudrate;
#if defined(HAVE_LIBUSB)
/* /*
* If the port name starts with "usb", divert the serial routines * If the port name starts with "usb", divert the serial routines
* to the USB ones. The serial_open() function for USB overrides * to the USB ones. The serial_open() function for USB overrides
@ -740,12 +739,16 @@ static int stk500v2_open(PROGRAMMER * pgm, char * port)
* search for. * search for.
*/ */
if (strncmp(port, "usb", 3) == 0) { if (strncmp(port, "usb", 3) == 0) {
#if defined(HAVE_LIBUSB)
serdev = &usb_serdev_frame; serdev = &usb_serdev_frame;
baud = USB_DEVICE_AVRISPMKII; baud = USB_DEVICE_AVRISPMKII;
is_mk2 = 1; is_mk2 = 1;
pgm->set_sck_period = stk500v2_set_sck_period_mk2; pgm->set_sck_period = stk500v2_set_sck_period_mk2;
} #else
fprintf(stderr, "avrdude was compiled without usb support.\n");
return -1;
#endif #endif
}
strcpy(pgm->port, port); strcpy(pgm->port, port);
pgm->fd = serial_open(port, baud); pgm->fd = serial_open(port, baud);