mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
Contributed by dcm@mit.edu: add support for the
AVRISP mkII device. (Savannah patch #4789.) * serial.h: Declare usb_serdev_frame device descriptor. * stk500v2.c: Implementation of the AVRISP mkII handling. * usb_libusb.c: Add USB handling for short-frame delimited AVRISP mkII USB protocol; add distinction of different devices in usbdev_open(). * jtagmkII.c: Tell usbdev_open() to search for the JTAG ICE mkII. * usbdevs.h: (New file.) * Makefile.am: Add usbdevs.h, as well as some other forgotten files "make distcheck" complained about. * avrdude.conf.in: Add more aliases for the AVRISP mkII. * avrdude.1: Document how to use the AVRISP mkII. * doc/avrdude.texi: (Ditto.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@564 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
33
jtagmkII.c
33
jtagmkII.c
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* avrdude - A Downloader/Uploader for AVR device programmers
|
||||
* Copyright (C) 2005 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
* Copyright (C) 2005,2006 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
*
|
||||
* Derived from stk500 code which is:
|
||||
* Copyright (C) 2002-2004 Brian S. Dean <bsd@bsdhome.com>
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "pgm.h"
|
||||
#include "jtagmkII_private.h"
|
||||
#include "serial.h"
|
||||
#include "usbdevs.h"
|
||||
|
||||
|
||||
extern int verbose;
|
||||
@@ -1044,26 +1045,34 @@ static void jtagmkII_enable(PROGRAMMER * pgm)
|
||||
|
||||
static int jtagmkII_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
long baud;
|
||||
|
||||
if (verbose >= 2)
|
||||
fprintf(stderr, "%s: jtagmkII_open()\n", progname);
|
||||
|
||||
#if defined(HAVE_LIBUSB)
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
* to the USB ones.
|
||||
*/
|
||||
if (strncmp(port, "usb", 3) == 0)
|
||||
serdev = &usb_serdev;
|
||||
#endif
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
/*
|
||||
* The JTAG ICE mkII always starts with a baud rate of 19200 Bd upon
|
||||
* attaching. If the config file or command-line parameters specify
|
||||
* a higher baud rate, we switch to it later on, after establishing
|
||||
* the connection with the ICE.
|
||||
*/
|
||||
pgm->fd = serial_open(port, 19200);
|
||||
baud = 19200;
|
||||
|
||||
#if defined(HAVE_LIBUSB)
|
||||
/*
|
||||
* If the port name starts with "usb", divert the serial routines
|
||||
* to the USB ones. The serial_open() function for USB overrides
|
||||
* the meaning of the "baud" parameter to be the USB device ID to
|
||||
* search for.
|
||||
*/
|
||||
if (strncmp(port, "usb", 3) == 0) {
|
||||
serdev = &usb_serdev;
|
||||
baud = USB_DEVICE_JTAGICEMKII;
|
||||
}
|
||||
#endif
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
pgm->fd = serial_open(port, baud);
|
||||
|
||||
/*
|
||||
* drain any extraneous input
|
||||
|
Reference in New Issue
Block a user