gloob / vusb-for-arduino

V-usb for Arduino with latest versions - Based on old project code.google.com/p/vusb-for-arduino
63 stars 19 forks source link

DDR and PORT take it from config #1

Open zaher opened 8 years ago

zaher commented 8 years ago

About line #138 in UsbKeyboard.h

    PORTD = 0; // TODO: Only for USB pins?
    DDRD |= ~USBMASK;

Replace it to take the port name from the usbconfig.h with this lines

    USBOUT = 0; // TODO: Only for USB pins?
    USBDDR |= ~USBMASK;

But not sure about it, not tested yet.

gloob commented 8 years ago

Hi @zaher! Thanks for reporting it, which is the issue that you are experiencing?

zaher commented 8 years ago

Yes, There is no PORTD in Attiny85/45, but there is PORTB AtTiny programmers fixed it manually, while we can put USBOUT instead, it is a marco to redefine it depend on the ports in usbconfig.h

Find in https://nathan.chantrell.net/20121014/tinypcremote-an-attiny85-based-infrared-pc-remote-control/#comment-390414 "Finally, in UsbKeyboard.h change:"

zaher commented 8 years ago

I tested it on AtTiny85, with PortB in usbconfig.h, and it works fine.