Fixed bug in RNDISEthernet and DualCDC demos not using the correct USB_ControlRequest...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / LowLevel.c
index 61acf6d..99b9cfb 100644 (file)
@@ -28,8 +28,6 @@
   this software.\r
 */\r
 \r
-#include "USBMode.h"\r
-\r
 #include "LowLevel.h"\r
 \r
 #if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))\r
@@ -94,7 +92,7 @@ void USB_Init(
        }\r
        else\r
        {\r
-               RAISE_EVENT(USB_PowerOnFail, POWERON_ERROR_NoUSBModeSpecified);\r
+               RAISE_EVENT(USB_InitFailure, USB_INITERROR_NoUSBModeSpecified);\r
                return;\r
        }\r
        #endif\r
@@ -152,10 +150,10 @@ void USB_ResetInterface(void)
        USB_INT_DisableAllInterrupts();\r
        USB_INT_ClearAllInterrupts();\r
 \r
-       USB_IsConnected          = false;\r
+       USB_IsConnected = false;\r
 \r
        #if defined(USB_CAN_BE_HOST)\r
-       USB_HostState            = HOST_STATE_Unattached;\r
+       USB_HostState = HOST_STATE_Unattached;\r
        #endif\r
 \r
        #if defined(USB_CAN_BE_DEVICE)\r
@@ -164,7 +162,7 @@ void USB_ResetInterface(void)
        USB_RemoteWakeupEnabled  = false;\r
        USB_CurrentlySelfPowered = false;\r
        #endif\r
-               \r
+       \r
        if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
        {\r
                #if defined(USB_MODIFIED_FULL_CONTROLLER)\r
@@ -225,7 +223,12 @@ void USB_ResetInterface(void)
        \r
        #if defined(USB_DEVICE_ONLY)    \r
        USB_INT_Enable(USB_INT_SUSPEND);\r
-       USB_INT_Enable(USB_INT_EORSTI); \r
+       USB_INT_Enable(USB_INT_EORSTI);\r
+\r
+       #if defined(CONTROL_ONLY_DEVICE)\r
+       UENUM = ENDPOINT_CONTROLEP;\r
+       #endif\r
+               \r
        #elif defined(USB_HOST_ONLY)\r
        USB_Host_HostMode_On();\r
        \r
@@ -242,6 +245,10 @@ void USB_ResetInterface(void)
        {\r
                USB_INT_Enable(USB_INT_SUSPEND);\r
                USB_INT_Enable(USB_INT_EORSTI);\r
+\r
+               #if defined(CONTROL_ONLY_DEVICE)\r
+               UENUM = ENDPOINT_CONTROLEP;\r
+               #endif\r
        }\r
        else if (USB_CurrentMode == USB_MODE_HOST)\r
        {\r