From 32f0f605efa293430a47d60bb857695ff6937d21 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 14 May 2009 10:07:08 +0000 Subject: Removed all user pipe/endpoint interrupt APIs, added internal library support for interrupt driven control endpoints when in device mode by defining INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch. --- LUFA/Drivers/USB/HighLevel/USBInterrupt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'LUFA/Drivers/USB/HighLevel/USBInterrupt.c') diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c index 93bd6d084..14d277c9a 100644 --- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c +++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c @@ -174,6 +174,10 @@ ISR(USB_GEN_vect, ISR_BLOCK) ENDPOINT_DIR_OUT, USB_ControlEndpointSize, ENDPOINT_BANK_SINGLE); + #if defined(INTERRUPT_CONTROL_ENDPOINT) + USB_INT_Enable(USB_INT_ENDPOINT_SETUP); + #endif + RAISE_EVENT(USB_Reset); } #endif @@ -249,3 +253,16 @@ ISR(USB_GEN_vect, ISR_BLOCK) } #endif } + +#if defined(INTERRUPT_CONTROL_ENDPOINT) +ISR(USB_COM_vect, ISR_BLOCK) +{ + uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint(); + + USB_USBTask(); + + USB_INT_Clear(USB_INT_ENDPOINT_SETUP); + + Endpoint_SelectEndpoint(PrevSelectedEndpoint); +} +#endif -- cgit v1.2.3