X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/6a10d6b465be27db090d760dc0fbe722c94e4344..1c12341cd73659a5c13b563b8cd682d766547af3:/LUFA/Drivers/USB/LowLevel/LowLevel.c diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index 61acf6def..16a50ac8f 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -28,8 +28,6 @@ this software. */ -#include "USBMode.h" - #include "LowLevel.h" #if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY)) @@ -94,7 +92,7 @@ void USB_Init( } else { - RAISE_EVENT(USB_PowerOnFail, POWERON_ERROR_NoUSBModeSpecified); + EVENT_USB_InitFailure(USB_INITERROR_NoUSBModeSpecified); return; } #endif @@ -113,7 +111,7 @@ void USB_Init( void USB_ShutDown(void) { if (USB_IsConnected) - RAISE_EVENT(USB_Disconnect); + EVENT_USB_Disconnect(); USB_Detach(); @@ -152,10 +150,10 @@ void USB_ResetInterface(void) USB_INT_DisableAllInterrupts(); USB_INT_ClearAllInterrupts(); - USB_IsConnected = 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) @@ -164,7 +162,7 @@ void USB_ResetInterface(void) USB_RemoteWakeupEnabled = false; USB_CurrentlySelfPowered = false; #endif - + if (!(USB_Options & USB_OPT_MANUAL_PLL)) { #if defined(USB_MODIFIED_FULL_CONTROLLER) @@ -208,7 +206,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; @@ -225,7 +223,11 @@ void USB_ResetInterface(void) #if defined(USB_DEVICE_ONLY) USB_INT_Enable(USB_INT_SUSPEND); - USB_INT_Enable(USB_INT_EORSTI); + USB_INT_Enable(USB_INT_EORSTI); + #if defined(CONTROL_ONLY_DEVICE) + UENUM = ENDPOINT_CONTROLEP; + #endif + #elif defined(USB_HOST_ONLY) USB_Host_HostMode_On(); @@ -242,6 +244,10 @@ void USB_ResetInterface(void) { USB_INT_Enable(USB_INT_SUSPEND); USB_INT_Enable(USB_INT_EORSTI); + + #if defined(CONTROL_ONLY_DEVICE) + UENUM = ENDPOINT_CONTROLEP; + #endif } else if (USB_CurrentMode == USB_MODE_HOST) {