volatile uint8_t USB_Options;
#endif
-USB_EP_TABLE_t USB_EndpointTable ATTR_ALIGNED(2);
+USB_EP_TABLE_t USB_EndpointTable ATTR_ALIGNED(4);
void USB_Init(
#if defined(USB_CAN_BE_BOTH)
NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc;
USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1));
+ USB.EPPTR = (intptr_t)&USB_EndpointTable;
+
if ((USB_Options & USB_OPT_BUSEVENT_PRIHIGH) == USB_OPT_BUSEVENT_PRIHIGH)
USB.INTCTRLA = (3 << USB_INTLVL_gp);
else if ((USB_Options & USB_OPT_BUSEVENT_PRIMED) == USB_OPT_BUSEVENT_PRIMED)
SetGlobalInterruptMask(CurrentGlobalInt);
- USB_ResetInterface();
+ USB_ResetInterface();
}
void USB_Disable(void)
else
CLK.USBCTRL = ((((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp) | CLK_USBSRC_PLL_gc | CLK_USBSEN_bm);
+ USB_Device_SetDeviceAddress(0);
+
USB_INT_DisableAllInterrupts();
USB_INT_ClearAllInterrupts();