diff --git a/ChangeLog b/ChangeLog index 00c5ec59..6d357e7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-10-27 Joerg Wunsch + + * jtagmkI.c: Implement a flags field in struct serdev, and populate it + with a flag that indicates whether the underlying communication can + dynamically change its speed or not. This flag is set for true serial + communication but clear for USB communication. Don't try to adjust + the speed when talking over a communication channel that doesn't + support it. (The Dragon does not even support the respective parameter.) + * jtagmkII.c: (Ditto.) + * ser_posix.c: (Ditto.) + * ser_win32.c: (Ditto.) + * serial.h: (Ditto.) + * usb_libusb.c: (Ditto.) + 2006-10-26 Joerg Wunsch * avrdude.conf.in: Add support for the AVR Dragon (JTAG and ISP mode). diff --git a/NEWS b/NEWS index 53d512d7..06e154bc 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,11 @@ Approximate change log for AVRDUDE by version. ---------------------------------------------------------------------- Current: + * Add support for the AVR Dragon (JTAG and ISP mode). + + +Version 5.2: + * New devices supported: - AT90USB646/647/1286/1287 diff --git a/jtagmkI.c b/jtagmkI.c index bd52b36e..7e976d58 100644 --- a/jtagmkI.c +++ b/jtagmkI.c @@ -553,7 +553,7 @@ static int jtagmkI_initialize(PROGRAMMER * pgm, AVRPART * p) jtagmkI_drain(pgm, 0); - if (initial_baudrate != pgm->baudrate) { + if ((serdev->flags & SERDEV_FL_CANSETSPEED) && initial_baudrate != pgm->baudrate) { if ((b = jtagmkI_get_baud(pgm->baudrate)) == 0) { fprintf(stderr, "%s: jtagmkI_initialize(): unsupported baudrate %d\n", progname, pgm->baudrate); diff --git a/jtagmkII.c b/jtagmkII.c index f43a0a6a..a4846626 100644 --- a/jtagmkII.c +++ b/jtagmkII.c @@ -1055,7 +1055,7 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p) return -1; } - if (pgm->baudrate && pgm->baudrate != 19200) { + if ((serdev->flags & SERDEV_FL_CANSETSPEED) && pgm->baudrate && pgm->baudrate != 19200) { if ((b = jtagmkII_get_baud(pgm->baudrate)) == 0) { fprintf(stderr, "%s: jtagmkII_initialize(): unsupported baudrate %d\n", progname, pgm->baudrate); diff --git a/ser_posix.c b/ser_posix.c index 9feffd06..ab1b76e5 100644 --- a/ser_posix.c +++ b/ser_posix.c @@ -481,6 +481,7 @@ struct serial_device serial_serdev = .send = ser_send, .recv = ser_recv, .drain = ser_drain, + .flags = SERDEV_FL_CANSETSPEED, }; struct serial_device *serdev = &serial_serdev; diff --git a/ser_win32.c b/ser_win32.c index 41d7ca3d..0864cbe9 100644 --- a/ser_win32.c +++ b/ser_win32.c @@ -364,6 +364,7 @@ struct serial_device serial_serdev = .send = ser_send, .recv = ser_recv, .drain = ser_drain, + .flags = SERDEV_FL_CANSETSPEED, }; struct serial_device *serdev = &serial_serdev; diff --git a/serial.h b/serial.h index ddfc6d9a..359ee1e8 100644 --- a/serial.h +++ b/serial.h @@ -41,6 +41,10 @@ struct serial_device int (*send)(int fd, unsigned char * buf, size_t buflen); int (*recv)(int fd, unsigned char * buf, size_t buflen); int (*drain)(int fd, int display); + + int flags; +#define SERDEV_FL_NONE 0x0000 /* no flags */ +#define SERDEV_FL_CANSETSPEED 0x0001 /* device can change speed */ }; extern struct serial_device *serdev; diff --git a/usb_libusb.c b/usb_libusb.c index a65d71bb..e733b077 100644 --- a/usb_libusb.c +++ b/usb_libusb.c @@ -202,11 +202,6 @@ static int usbdev_open(char * port, long baud) exit(1); } -static int usbdev_setspeed(int fd, long baud) -{ - return 0; -} - static void usbdev_close(int fd) { usb_dev_handle *udev = (usb_dev_handle *)fd; @@ -431,11 +426,11 @@ static int usbdev_drain(int fd, int display) struct serial_device usb_serdev = { .open = usbdev_open, - .setspeed = usbdev_setspeed, .close = usbdev_close, .send = usbdev_send, .recv = usbdev_recv, .drain = usbdev_drain, + .flags = SERDEV_FL_NONE, }; /* @@ -444,11 +439,11 @@ struct serial_device usb_serdev = struct serial_device usb_serdev_frame = { .open = usbdev_open, - .setspeed = usbdev_setspeed, .close = usbdev_close, .send = usbdev_send, .recv = usbdev_recv_frame, .drain = usbdev_drain, + .flags = SERDEV_FL_NONE, }; #endif /* HAVE_LIBUSB */