Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOI...
[pub/USBasp.git] / Demos / Host / MouseHost / MouseHost.c
index dda4d62..dd7ff73 100644 (file)
@@ -346,6 +346,9 @@ TASK(USB_Mouse_Host)
  */\r
 ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
 {\r
+       /* Save previously selected pipe before selecting a new pipe */\r
+       uint8_t PrevSelectedPipe = Pipe_GetCurrentPipe();\r
+\r
        /* Check to see if the mouse data pipe has caused the interrupt */\r
        if (Pipe_HasPipeInterrupted(MOUSE_DATAPIPE))\r
        {\r
@@ -363,5 +366,8 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
                        ReadNextReport();\r
                }\r
        }\r
+\r
+       /* Restore previously selected pipe */\r
+       Pipe_SelectPipe(PrevSelectedPipe);\r
 }\r
 #endif\r