X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c20a94a4e84c89debf5e7109482ede708a694a0c..b9b03aadb219d06fbad9d110e508db93e45461af:/LUFA/Drivers/USB/LowLevel/LowLevel.c diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index 3994e2f11..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,10 +152,12 @@ void USB_ResetInterface(void) USB_INT_DisableAllInterrupts(); USB_INT_ClearAllInterrupts(); - USB_IsConnected = false; + FrameElapsed = false; + + USB_IsConnected = false; #if defined(USB_CAN_BE_HOST) - USB_HostState = HOST_STATE_Unattached; + USB_HostState = HOST_STATE_Unattached; #endif #if defined(USB_CAN_BE_DEVICE) @@ -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