vusb-for-arduino icon indicating copy to clipboard operation
vusb-for-arduino copied to clipboard

DDR and PORT take it from config

Open zaher opened this issue 9 years ago • 3 comments

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.

zaher avatar Jun 20 '16 01:06 zaher

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

gloob avatar Jun 21 '16 12:06 gloob

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 avatar Jun 21 '16 13:06 zaher

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

zaher avatar Jun 23 '16 00:06 zaher