From 358961e07e27bd2c917af9cc912150e2dd476bd6 Mon Sep 17 00:00:00 2001 From: joerg_wunsch Date: Wed, 11 May 2011 20:42:27 +0000 Subject: [PATCH] Bump timeout values to allow for slow clock speeds. Ideally, the timeout should depend on the selected clock speed, but changing the API for that would require quite some effort throughout the entire code base. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@954 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 6 ++++++ jtagmkII.c | 2 +- usb_libusb.c | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9530eab8..2f67633d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-11 Joerg Wunsch + + * usb_libusb.c: Bump timeout values to allow for slow clock + speeds. + * jtagmkII.c: (Ditto.) + 2011-03-04 Eric B. Weddington Thanks to Vitaly Chernookiy for the patch. diff --git a/jtagmkII.c b/jtagmkII.c index 8ca265dc..259ba6e9 100644 --- a/jtagmkII.c +++ b/jtagmkII.c @@ -483,7 +483,7 @@ static int jtagmkII_recv_frame(PROGRAMMER * pgm, unsigned char **msg, unsigned short checksum = 0; struct timeval tv; - double timeoutval = 5; /* seconds */ + double timeoutval = 100; /* seconds */ double tstart, tnow; if (verbose >= 4) diff --git a/usb_libusb.c b/usb_libusb.c index a3cbea04..cc476a6d 100644 --- a/usb_libusb.c +++ b/usb_libusb.c @@ -269,7 +269,7 @@ static int usbdev_send(union filedescriptor *fd, unsigned char *bp, size_t mlen) */ do { tx_size = (mlen < USBDEV_MAX_XFER)? mlen: USBDEV_MAX_XFER; - rv = usb_bulk_write(udev, USBDEV_BULK_EP_WRITE, (char *)bp, tx_size, 5000); + rv = usb_bulk_write(udev, USBDEV_BULK_EP_WRITE, (char *)bp, tx_size, 100000); if (rv != tx_size) { fprintf(stderr, "%s: usbdev_send(): wrote %d out of %d bytes, err = %s\n", @@ -315,7 +315,7 @@ usb_fill_buf(usb_dev_handle *udev, int ep) { int rv; - rv = usb_bulk_read(udev, ep, usbbuf, USBDEV_MAX_XFER, 5000); + rv = usb_bulk_read(udev, ep, usbbuf, USBDEV_MAX_XFER, 100000); if (rv < 0) { if (verbose > 1) @@ -393,7 +393,7 @@ static int usbdev_recv_frame(union filedescriptor *fd, unsigned char *buf, size_ do { rv = usb_bulk_read(udev, fd->usb.ep, usbbuf, - USBDEV_MAX_XFER, 10000); + USBDEV_MAX_XFER, 100000); if (rv < 0) { if (verbose > 1)