abcminiuser / lufa

LUFA - the Lightweight USB Framework for AVRs.
http://www.lufa-lib.org
1.04k stars 325 forks source link

UC3 device mode double bank endpoints not initializing correctly since version 120730 and later #122

Closed laid closed 6 years ago

laid commented 6 years ago

Apparently the USB device endpoint double banking is broken since version 120730.

In Endpoint_UC3.h there is a call:

return Endpoint_ConfigureEndpoint_Prv(Number, (AVR32_USBB_ALLOC_MASK | ((uint32_t)Type << AVR32_USBB_EPTYPE_OFFSET) | ((Address & ENDPOINT_DIR_IN) ? AVR32_USBB_UECFG0_EPDIR_MASK : 0) | ((Banks > 1) ? AVR32_USBB_UECFG0_EPBK_SINGLE : AVR32_USBB_UECFG0_EPBK_DOUBLE) | Endpoint_BytesToEPSizeMask(Size)));

It is supposed to be:

return Endpoint_ConfigureEndpoint_Prv(Number, (AVR32_USBB_ALLOC_MASK | ((uint32_t)Type << AVR32_USBB_EPTYPE_OFFSET) | ((Address & ENDPOINT_DIR_IN) ? AVR32_USBB_UECFG0_EPDIR_MASK : 0) | (((Banks > 1) ? AVR32_USBB_UECFG0_EPBK_DOUBLE : AVR32_USBB_UECFG0_EPBK_SINGLE) << AVR32_USBB_EPBK_OFFSET) | Endpoint_BytesToEPSizeMask(Size)));

abcminiuser commented 6 years ago

Thanks! Fixed in https://github.com/abcminiuser/lufa/commit/e2d1b437c7454e621a349c9ba47ecfdf91f8fab2.