Renamed Serial_Stream driver to SerialStream to remain consistent with the rest of...
[pub/lufa.git] / LUFA / Drivers / USB / HighLevel / USBTask.c
index 6967023..80731ac 100644 (file)
@@ -28,7 +28,7 @@
   this software.\r
 */\r
 \r
-#include "../LowLevel/USBMode.h"\r
+#include "USBMode.h"\r
 \r
 #define  INCLUDE_FROM_USBTASK_C\r
 #include "USBTask.h"\r
@@ -64,7 +64,7 @@ static void USB_DeviceTask(void)
        \r
                Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
 \r
-               if (Endpoint_IsSetupReceived())\r
+               if (Endpoint_IsSETUPReceived())\r
                {\r
                        ATOMIC_BLOCK(ATOMIC_RESTORESTATE)\r
                        {\r
@@ -86,6 +86,10 @@ static void USB_HostTask(void)
        static uint16_t WaitMSRemaining;\r
        static uint8_t  PostWaitState;\r
 \r
+       uint8_t PrevPipe = Pipe_GetCurrentPipe();\r
+\r
+       Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
+\r
        switch (USB_HostState)\r
        {\r
                case HOST_STATE_WaitForDevice:\r
@@ -94,7 +98,7 @@ static void USB_HostTask(void)
                                if ((SubErrorCode = USB_Host_WaitMS(1)) != HOST_WAITERROR_Successful)\r
                                {\r
                                        USB_HostState = PostWaitState;\r
-                                       ErrorCode    = HOST_ENUMERROR_WaitStage;\r
+                                       ErrorCode     = HOST_ENUMERROR_WaitStage;\r
                                        break;\r
                                }\r
                                \r
@@ -249,5 +253,7 @@ static void USB_HostTask(void)
 \r
                USB_ResetInterface();\r
        }\r
+       \r
+       Pipe_SelectPipe(PrevPipe);\r
 }\r
 #endif\r