X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/13935a31b9bb1360c9e46c0893e77e0c47761cb9..b9b03aadb219d06fbad9d110e508db93e45461af:/LUFA/Drivers/USB/LowLevel/LowLevel.c?ds=inline diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index 1616ae520..82705db96 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -38,6 +38,8 @@ volatile uint8_t USB_CurrentMode = USB_MODE_NONE; volatile uint8_t USB_Options; #endif +volatile bool FrameElapsed; + void USB_Init( #if defined(USB_CAN_BE_BOTH) const uint8_t Mode @@ -92,7 +94,7 @@ void USB_Init( } else { - RAISE_EVENT(USB_PowerOnFail, POWERON_ERROR_NoUSBModeSpecified); + EVENT_USB_InitFailure(USB_INITERROR_NoUSBModeSpecified); return; } #endif @@ -111,7 +113,7 @@ void USB_Init( void USB_ShutDown(void) { if (USB_IsConnected) - RAISE_EVENT(USB_Disconnect); + EVENT_USB_Disconnect(); USB_Detach(); @@ -150,6 +152,8 @@ void USB_ResetInterface(void) USB_INT_DisableAllInterrupts(); USB_INT_ClearAllInterrupts(); + FrameElapsed = false; + USB_IsConnected = false; #if defined(USB_CAN_BE_HOST) @@ -206,7 +210,7 @@ void USB_ResetInterface(void) { USB_Descriptor_Device_t* DeviceDescriptorPtr; - if (USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR) + if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR) { #if defined(USE_RAM_DESCRIPTORS) USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size; @@ -224,7 +228,6 @@ void USB_ResetInterface(void) #if defined(USB_DEVICE_ONLY) USB_INT_Enable(USB_INT_SUSPEND); USB_INT_Enable(USB_INT_EORSTI); - #if defined(CONTROL_ONLY_DEVICE) UENUM = ENDPOINT_CONTROLEP; #endif