Commit Graph

15 Commits

Author SHA1 Message Date
Joerg Wunsch 852c53d4ac usbdev_close(): Repair the logic around the
conditional compilation of usb_reset() introduced in r798.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@841 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-08-17 04:15:08 +00:00
Joerg Wunsch 27223edf7f Submitted by Nick Hibma:
bug #22271: usb_reset in usb_libusb.c not necessary in FreeBSD 6.x
* usb_libusb.c (usbdev_close): Do not call usb_reset() on FreeBSD.
It is not necessary there.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@798 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-02-17 17:09:53 +00:00
Joerg Wunsch 876f79a141 #undef interface for Win32
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@770 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-03-29 22:10:11 +00:00
Joerg Wunsch ec2df64017 Add initial support for the Atmel STK600, for
"classic" AVRs (AT90, ATtiny, ATmega) in both,
ISP and high-voltage programming modes.
* Makefile.am: Add -lm.
* avrdude.conf.in: Add stk600, stk600pp, and stk600hvsp.
* config_gram.y: Add support for the stk600* keywords.
* lexer.l: (Ditto.)
* pgm.h: Add the "chan" parameter to set_varef().
* stk500.c: (Ditto.)
* serial.h: Add USB endpoint support to struct filedescriptor.
* stk500v2.c: Implement the meat of the STK600 support.
* stk500v2.h: Add new prototypes for stk600*() programmers.
* stk500v2_private.h: Add new constants used in the STK600.
* term.c: Add AREF channel support.
* usb_libusb.c: Automatically determine the correct write
endpoint ID, the STK600 uses 0x83 while all other tools use
0x82.  Propagate the EP to use through struct filedescriptor.
* usbdevs.h: Add the STK600 USB product ID.
* tools/get-stk600-cards.xsl: XSL transformation for
targetboards.xml to obtain the list of socket and routing
card IDs, to be used in stk500v2.c (for displaying the
names).
* tools/get-stk600-devices.xsl: XSL transformation for
targetboards.xml to obtain the table of socket/routing cards
and their respective AVR device support for doc/avrdude.texi.
* avrdude.1: Document all the STK600 stuff.
* doc/avrdude.texi: Ditto.  Added a new chapter for
Programmer Specific Information.

Thanks to Eirik Rasmussen from Atmel Norway for his support in
getting this code running within that short amount of time!


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@768 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-03-14 13:00:08 +00:00
Joerg Wunsch 27e16e8371 Something I always wanted to do: replace all those private "extern"
declarations in each file by a central header file "avrdude.h".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@721 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 21:07:54 +00:00
Joerg Wunsch 7e20e7571f Make the code compile warning-free:
- declare a dummy "struct timezone" for some Win32 systems (MinGW)
- fix a few printf() argument types
- get rid off the prevailing "all filedescriptors are of type int"
  attitude

The last item required a large sweep across the code, in order to
replace all "int fd"s by "struct filedescriptor *fd"s, and pass
pointers (as we cannot pass a union directly).  In return, the
code is now supposed to be fully 64-bit safe, rather than relying
on a 64-bit pointer being converted to a (32-bit) int and back
to a pointer as we did previously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@694 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 12:47:35 +00:00
Joerg Wunsch 4e81a6be72 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.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@676 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-27 08:45:47 +00:00
Joerg Wunsch 008a12f982 Replace David's email address by his full name in the copyrights.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@565 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-01-12 23:24:35 +00:00
Joerg Wunsch d98636cfad 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
2006-01-12 23:13:50 +00:00
Joerg Wunsch 03ff61ab12 A number of fixes for the libusb handling:
. use the correct endpoint, depending on whether we are going to read
  or write
. when opening the USB device, set the configuration according to the
  config entry, and properly claim the interface
. when closing, release the interface again

With these changes, it works now with libusb-win32 as well.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@533 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-26 12:19:01 +00:00
Joerg Wunsch 0519f51b5d * usb_libusb.c (usbdev_drain): actually implement draining to aid
synchronizing against a JTAG ICE in weird state.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@497 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 15:01:52 +00:00
Joerg Wunsch 940c7ca1ac Consitently use unsigned char for buffers to avoid warnings.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@492 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-30 04:44:29 +00:00
Joerg Wunsch 258eb700d7 On one of my systems (a not-too-current FreeBSD 5.x), libusb appears
to have problems sending a control message (returns an "I/O error").
At least try to recover gracefully in the bening case where the user
did not request a particular serial number, so we could continue
anyway without knowing it.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@481 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-25 19:52:20 +00:00
Joerg Wunsch 899ef71424 Remove the check for the root dev. The required functionality is only
available in recent versions of libusb, and the check isn't really
needed anyway (as the check for vendor and product ID will cover that
as well).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@479 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-20 18:12:04 +00:00
Joerg Wunsch f5882fc781 Implement and document a libusb-based USB transport for the JTAG ICE
mkII.

The serial transport methods have been moved out into a record of
function pointers for that purpose, defaulting to the actual serial
connection that natively applies to the hosting system.  Iff inside
the JTAG ICE mkII handler a port name starting with "usb" has been
detected, the record of function pointers is switched to USB.
Optionally, a serial number might be specified, so only the JTAG ICE
mkII matching the given serial number will be opened.  The match is
done right-to-left, so only the least significant bytes of the serial
number need to be given.

In order to make the change as least intrusive to existing drivers as
possible, the entire naming scheme of the serial_foo() function entry
points has been maintained as access macros that encapsulate these
into the respective indirect function calls via serdev->foo().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@478 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-19 21:38:03 +00:00