From ece9e3d5991dd481fc36baf799a1a85d14b88251 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 1 Apr 2009 07:43:50 +0000 Subject: Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOINT and INTERRUPT_CONTROL_ENDPOINT compile time options. --- Demos/Host/GenericHIDHost/GenericHIDHost.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Demos/Host/GenericHIDHost') diff --git a/Demos/Host/GenericHIDHost/GenericHIDHost.c b/Demos/Host/GenericHIDHost/GenericHIDHost.c index 625ca7023..c703039f3 100644 --- a/Demos/Host/GenericHIDHost/GenericHIDHost.c +++ b/Demos/Host/GenericHIDHost/GenericHIDHost.c @@ -350,6 +350,9 @@ TASK(USB_HID_Host) */ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK) { + /* Save previously selected pipe before selecting a new pipe */ + uint8_t PrevSelectedPipe = Pipe_GetCurrentPipe(); + /* Check to see if the HID data IN pipe has caused the interrupt */ if (Pipe_HasPipeInterrupted(HID_DATA_IN_PIPE)) { @@ -367,5 +370,8 @@ ISR(ENDPOINT_PIPE_vect, ISR_BLOCK) ReadNextReport(); } } + + /* Restore previously selected pipe */ + Pipe_SelectPipe(PrevSelectedPipe); } #endif -- cgit v1.2.3