kevinmehall / usb

Minimalist portable USB device stack for SAMD21, LPC1800, LPC4300, Xmega
MIT License
101 stars 20 forks source link

XMEGA endpoints not enabled #8

Open kuro68k opened 7 years ago

kuro68k commented 7 years ago

In usb_xmega.c, it should be

inline void usb_ep_enable(uint8_t ep, uint8_t type, usb_size bufsize){
    _USB_EP(ep);
    e->STATUS = USB_EP_BUSNACK0_bm;
    e->CTRL = (type << USB_EP_TYPE_gp) | USB_EP_size_to_gc(bufsize);
}

The type is not shifted into position correctly, so the endpoint never gets enabled.