This does unfortunately not compile under FreeBSD where the OS
offers a libusb-1.0 API compatible USB library:
So it seems the libusb_has_capability() needs an explicit
probing in configure.ac as it has not always been part of
the libusb-1.0 API. (Unfortunately, LIBUSB_CAP_HAS_CAPABILITY
is part of an enum rather than a #define, so it cannot be
tested at compile-time. Seems someone didn't really think
about that detail before.)
The warnings about char vs. uint8_t * can probably safely
be silenced using typecasts.
|
I tried using an AVRISPmkII in Windows 10 with avrdude 6.3, but libusb couldn't find the device ("avrdude.exe: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)").
Since libusb 0.1 is marked deprecated in cygwin, I installed libusb-1.0 and had a look at usbasp.c, where v1.0 is already in use. I then added support for libusb-1.0 in usb_libusb.c, and expanded the corresponding preprocessor conditions in jtag3.c, jtagmkII.c and stk500v2.c.
After replacing the ATMEL driver of the AVRISP by the WinUSB driver using Zadig avrdude is once more able to flash my AVRs using AVRISPmkII.
I also successfully applied and tested my patch with said AVRISPmkII in a virtual machine running xubuntu 14.04.
|